Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterMetrics()
- func SinkerSetup(ctx context.Context, dsnString string, pkg *pbsubstreams.Package, ...) error
- type GenerateCSVSinker
- func (s *GenerateCSVSinker) HandleBlockRangeCompletion(ctx context.Context, cursor *sink.Cursor) error
- func (s *GenerateCSVSinker) HandleBlockScopedData(ctx context.Context, data *pbsubstreamsrpc.BlockScopedData, isLive *bool, ...) error
- func (s *GenerateCSVSinker) HandleBlockUndoSignal(ctx context.Context, data *pbsubstreamsrpc.BlockUndoSignal, ...) error
- func (s *GenerateCSVSinker) Run(ctx context.Context)
- type SQLSinker
- func (s *SQLSinker) Close() error
- func (s *SQLSinker) HandleBlockRangeCompletion(ctx context.Context, cursor *sink.Cursor) error
- func (s *SQLSinker) HandleBlockScopedData(ctx context.Context, data *pbsubstreamsrpc.BlockScopedData, isLive *bool, ...) error
- func (s *SQLSinker) HandleBlockUndoSignal(ctx context.Context, data *pbsubstreamsrpc.BlockUndoSignal, ...) error
- func (s *SQLSinker) Run(ctx context.Context)
- type SinkerFactoryFunc
- type SinkerFactoryOptions
- type SinkerSetupOptions
- type Stats
- func (s *Stats) AverageFlushDuration() time.Duration
- func (s *Stats) Close()
- func (s *Stats) LogNow()
- func (s *Stats) RecordBlock(block bstream.BlockRef)
- func (s *Stats) RecordFlushDuration(duration time.Duration)
- func (s *Stats) RecordHandleBlockDuration(duration time.Duration)
- func (s *Stats) RecordHandleUndoDuration(duration time.Duration)
- func (s *Stats) Start(each time.Duration, cursor *sink.Cursor)
Constants ¶
View Source
const BLOCK_FLUSH_INTERVAL_DISABLED = 0
Variables ¶
View Source
var FlushCount = metrics.NewCounter("substreams_sink_postgres_store_flush_count", "The amount of flush that happened so far")
View Source
var FlushDuration = metrics.NewCounter("substreams_sink_postgres_store_flush_duration", "The amount of time spent flushing cache to db (in nanoseconds)")
View Source
var FlushedHeadBlockNumber = metrics.NewHeadBlockNumber("substreams_sink_postgres")
View Source
var FlushedHeadBlockTimeDrift = metrics.NewHeadTimeDrift("substreams_sink_postgres")
View Source
var FlushedRowsCount = metrics.NewCounter("substreams_sink_postgres_flushed_rows_count", "The number of flushed rows so far")
Functions ¶
func RegisterMetrics ¶
func RegisterMetrics()
func SinkerSetup ¶
func SinkerSetup( ctx context.Context, dsnString string, pkg *pbsubstreams.Package, options SinkerSetupOptions, logger *zap.Logger, tracer logging.Tracer, ) error
SinkerSetup sets up the required infrastructure for a Substreams SQL sink
Types ¶
type GenerateCSVSinker ¶
type GenerateCSVSinker struct {
*shutter.Shutter
*sink.Sinker
// contains filtered or unexported fields
}
func NewGenerateCSVSinker ¶
func (*GenerateCSVSinker) HandleBlockRangeCompletion ¶
func (*GenerateCSVSinker) HandleBlockScopedData ¶
func (s *GenerateCSVSinker) HandleBlockScopedData(ctx context.Context, data *pbsubstreamsrpc.BlockScopedData, isLive *bool, cursor *sink.Cursor) error
func (*GenerateCSVSinker) HandleBlockUndoSignal ¶
func (s *GenerateCSVSinker) HandleBlockUndoSignal(ctx context.Context, data *pbsubstreamsrpc.BlockUndoSignal, cursor *sink.Cursor) error
func (*GenerateCSVSinker) Run ¶
func (s *GenerateCSVSinker) Run(ctx context.Context)
type SQLSinker ¶
func (*SQLSinker) HandleBlockRangeCompletion ¶
func (*SQLSinker) HandleBlockScopedData ¶
func (s *SQLSinker) HandleBlockScopedData(ctx context.Context, data *pbsubstreamsrpc.BlockScopedData, isLive *bool, cursor *sink.Cursor) error
func (*SQLSinker) HandleBlockUndoSignal ¶
func (s *SQLSinker) HandleBlockUndoSignal(ctx context.Context, data *pbsubstreamsrpc.BlockUndoSignal, cursor *sink.Cursor) error
type SinkerFactoryFunc ¶
type SinkerFactoryFunc func(ctx context.Context, dsnString string, logger *zap.Logger, tracer logging.Tracer) (*SQLSinker, error)
func SinkerFactory ¶
func SinkerFactory( baseSink *sink.Sinker, options SinkerFactoryOptions, ) SinkerFactoryFunc
type SinkerFactoryOptions ¶
type SinkerSetupOptions ¶
type SinkerSetupOptions struct {
CursorTableName string
HistoryTableName string
ClickhouseCluster string
OnModuleHashMismatch string
SystemTablesOnly bool
IgnoreDuplicateTableErrors bool
Postgraphile bool
}
SinkerSetupOptions contains configuration for the setup operation
type Stats ¶
func (*Stats) AverageFlushDuration ¶
func (*Stats) RecordBlock ¶
func (*Stats) RecordFlushDuration ¶
func (*Stats) RecordHandleBlockDuration ¶
func (*Stats) RecordHandleUndoDuration ¶
Click to show internal directories.
Click to hide internal directories.