sinker

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const BLOCK_PROGRESS = 1000

Variables

View Source
var BlockCount = metrics.NewCounter("substreams_sink_kv_block_count", "The number of blocks received")
View Source
var DataMessageCount = metrics.NewCounterVec("substreams_sink_kv_data_message", []string{"module"}, "The number of data message received")
View Source
var FlushCount = metrics.NewCounter("substreams_sink_kv_store_flush_count", "The amount of flush that happened so far")
View Source
var FlushDuration = metrics.NewCounter("substreams_sink_kv_store_flush_duration", "The amount of time spent flushing cache to db")
View Source
var FlushedEntriesCount = metrics.NewCounter("substreams_sink_kv_flushed_entries_count", "The number of flushed entries")
View Source
var ProgressMessageCount = metrics.NewCounterVec("substreams_sink_kv_progress_message", []string{"module"}, "The number of progress message received")
View Source
var SubstreamsErrorCount = metrics.NewCounter("substreams_sink_kv_error", "The error count we encountered when interacting with Substreams for which we had to restart the connection loop")

Functions

func RegisterMetrics

func RegisterMetrics()

Types

type Config

type Config struct {
	BlockRange       string
	Pkg              *pbsubstreams.Package
	OutputModule     *pbsubstreams.Module
	OutputModuleName string
	OutputModuleHash manifest.ModuleHash
	ClientConfig     *client.SubstreamsClientConfig
	DBLoader         db.DBLoader
}

type KVSinker

type KVSinker struct {
	*shutter.Shutter

	DBLoader         db.DBLoader
	Pkg              *pbsubstreams.Package
	OutputModule     *pbsubstreams.Module
	OutputModuleName string
	OutputModuleHash manifest.ModuleHash
	ClientConfig     *client.SubstreamsClientConfig
	// contains filtered or unexported fields
}

func New

func New(config *Config, logger *zap.Logger, tracer logging.Tracer) (*KVSinker, error)

func (*KVSinker) Run

func (s *KVSinker) Run(ctx context.Context) error

func (*KVSinker) Start

func (s *KVSinker) Start(ctx context.Context) error

func (*KVSinker) Stop

func (s *KVSinker) Stop(ctx context.Context, err error)

type Stats

type Stats struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

func NewStats

func NewStats(logger *zap.Logger) *Stats

func (*Stats) Close

func (s *Stats) Close()

func (*Stats) RecordBlock

func (s *Stats) RecordBlock(block bstream.BlockRef)

func (*Stats) Start

func (s *Stats) Start(each time.Duration)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL