Documentation
¶
Index ¶
- Variables
- func ParseTestModeDSN(dsn string) (endpoint string, apiKey string, apiToken string, insecure bool, plaintext bool, ...)
- type Archiver
- type BlockLineConsoleReader
- type CloseableConsoleReader
- type ConsolerReader
- type ConsolerReaderFactory
- type FileUploader
- type MindReaderPlugin
- func (p *MindReaderPlugin) LastSeenBlock() bstream.BlockRef
- func (p *MindReaderPlugin) Launch()
- func (p *MindReaderPlugin) LogBlockLine(block *consoleline.Block)
- func (p *MindReaderPlugin) LogLine(in string)
- func (p *MindReaderPlugin) Name() string
- func (p *MindReaderPlugin) OnBlockWritten(callback nodeManager.OnBlockWritten)
- func (p *MindReaderPlugin) ReadsBlockLines() bool
- func (p *MindReaderPlugin) Stop()
- type TestModeComparator
- func (c *TestModeComparator) AgainstDSN() string
- func (c *TestModeComparator) Close() error
- func (c *TestModeComparator) CompareBlock(ctx context.Context, testingBlock *pbbstream.Block) error
- func (c *TestModeComparator) DiffOutput() string
- func (c *TestModeComparator) MarshalLogObject(enc zapcore.ObjectEncoder) error
- type TestModeConfig
Constants ¶
This section is empty.
Variables ¶
var TestModeBlocksCompared = testModeMetrics.NewCounter("blocks_compared_total", "Total number of blocks successfully compared (matched + mismatched)")
var TestModeBlocksComparedMatched = testModeMetrics.NewCounter("blocks_compared_matched_total", "Total number of blocks that matched production")
var TestModeBlocksComparedMismatched = testModeMetrics.NewCounter("blocks_compared_mismatched_total", "Total number of blocks that did not match production")
var TestModeBlocksFetchFailure = testModeMetrics.NewCounter("blocks_fetch_failure_total", "Total number of blocks that failed to fetch from production")
var TestModeBlocksReorg = testModeMetrics.NewCounter("blocks_reorg_total", "Total number of blocks skipped due to re-org (block ID mismatch)")
var TestModeBlocksSeen = testModeMetrics.NewCounter("blocks_seen_total", "Total number of blocks seen in test mode (includes all blocks attempted)")
Counter metrics
var TestModeFailurePercentage = testModeMetrics.NewGauge("failure_percentage", "Percentage of compared blocks that did not match production")
var TestModeSuccessPercentage = testModeMetrics.NewGauge("success_percentage", "Percentage of compared blocks that matched production")
Gauge metrics for percentages
Functions ¶
func ParseTestModeDSN ¶ added in v1.11.3
func ParseTestModeDSN(dsn string) (endpoint string, apiKey string, apiToken string, insecure bool, plaintext bool, err error)
ParseTestModeDSN parses the DSN format: http(s)://host:port[?insecure=true][&apiKey=key] Also checks FIREHOSE_API_KEY and FIREHOSE_API_TOKEN environment variables
Types ¶
type Archiver ¶
func NewArchiver ¶
type BlockLineConsoleReader ¶ added in v1.20.0
type BlockLineConsoleReader interface {
ConsolerReader
ReadLines(lines <-chan consoleline.Line)
}
BlockLineConsoleReader is a ConsolerReader that reads "FIRE BLOCK" lines whose payload was decoded while it was read out of the node, see consoleline.Splitter. Its lines then come from the channel given to ReadLines instead of the one given to its factory.
type CloseableConsoleReader ¶ added in v1.1.0
type CloseableConsoleReader interface {
ConsolerReader
Close() error
}
type ConsolerReader ¶
type ConsolerReaderFactory ¶
type ConsolerReaderFactory func(lines chan string) (ConsolerReader, error)
type FileUploader ¶
func NewFileUploader ¶
func (*FileUploader) Done ¶ added in v1.16.1
func (fu *FileUploader) Done() <-chan struct{}
Done is closed once the upload loop has fully stopped, after a final upload pass has drained the remaining local files.
func (*FileUploader) Start ¶
func (fu *FileUploader) Start(ctx context.Context)
type MindReaderPlugin ¶
func NewMindReaderPlugin ¶
func NewMindReaderPlugin( oneBlocksStoreURL string, workingDirectory string, consoleReaderFactory ConsolerReaderFactory, startBlockNum uint64, stopBlockNum uint64, channelCapacity int, headBlockUpdater nodeManager.HeadBlockUpdater, shutdownFunc func(error), oneBlockSuffix string, blockStreamServer *blockstream.Server, testModeComparator *TestModeComparator, zlogger *zap.Logger, tracer logging.Tracer, ) (*MindReaderPlugin, error)
NewMindReaderPlugin initiates its own: * ConsoleReader (from given Factory) * Archiver (from archive store params) * Shutter
func (*MindReaderPlugin) LastSeenBlock ¶
func (p *MindReaderPlugin) LastSeenBlock() bstream.BlockRef
GetMindreaderLineChannel is a marker method that `superviser.Superviser` uses to determine if `logplugin.LogPlugin` is an actual mindreader plugin without depending on the `mindreader` package in which case it would create an import cycle.
The `superviser.Superviser` defines `type mindreaderPlugin interface { LastSeenBlockNum() bstream.BlockRef }` which is respected. This is a trick to avoid circual dependency in imports.
func (*MindReaderPlugin) Launch ¶
func (p *MindReaderPlugin) Launch()
func (*MindReaderPlugin) LogBlockLine ¶ added in v1.20.0
func (p *MindReaderPlugin) LogBlockLine(block *consoleline.Block)
LogBlockLine receives a "FIRE BLOCK" line whose payload was decoded while it was read.
func (*MindReaderPlugin) LogLine ¶
func (p *MindReaderPlugin) LogLine(in string)
LogLine receives log line and write it to "pipe" of the local console reader
func (*MindReaderPlugin) Name ¶
func (p *MindReaderPlugin) Name() string
func (*MindReaderPlugin) OnBlockWritten ¶
func (p *MindReaderPlugin) OnBlockWritten(callback nodeManager.OnBlockWritten)
func (*MindReaderPlugin) ReadsBlockLines ¶ added in v1.20.0
func (p *MindReaderPlugin) ReadsBlockLines() bool
ReadsBlockLines reports whether "FIRE BLOCK" lines must be given to LogBlockLine instead of LogLine. It is only meaningful once the plugin is launched.
func (*MindReaderPlugin) Stop ¶
func (p *MindReaderPlugin) Stop()
type TestModeComparator ¶ added in v1.11.3
type TestModeComparator struct {
// contains filtered or unexported fields
}
func NewTestModeComparator ¶ added in v1.11.3
func (*TestModeComparator) AgainstDSN ¶ added in v1.11.3
func (c *TestModeComparator) AgainstDSN() string
func (*TestModeComparator) Close ¶ added in v1.11.3
func (c *TestModeComparator) Close() error
Close is safe to call multiple times, from any goroutine. The comparator is shut down from more than one place depending on the app: `reader-node` closes it from the mindreader consume flow, `reader-node-firehose` from the app's `Run`, and a nil comparator (test mode disabled) closes to a no-op.
func (*TestModeComparator) CompareBlock ¶ added in v1.11.3
func (*TestModeComparator) DiffOutput ¶ added in v1.11.3
func (c *TestModeComparator) DiffOutput() string
func (*TestModeComparator) MarshalLogObject ¶ added in v1.11.3
func (c *TestModeComparator) MarshalLogObject(enc zapcore.ObjectEncoder) error