Documentation ¶
Index ¶
- func Emit(ctx context.Context, event Event)
- func Register(name string, factory FactoryFunc)
- func RegisterNull()
- func SetDefaultEmitter(m EventEmitter)
- func WithBytesMeter(ctx context.Context) context.Context
- func WithCounter(ctx context.Context, name string) context.Context
- func WithExistingBytesMeter(ctx context.Context, bm Meter) context.Context
- type Event
- type EventEmitter
- type FactoryFunc
- type Meter
- type MeterLogData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, factory FactoryFunc)
func RegisterNull ¶
func RegisterNull()
func SetDefaultEmitter ¶
func SetDefaultEmitter(m EventEmitter)
Types ¶
type Event ¶
type Event struct { Endpoint string `json:"endpoint"` Metrics map[string]float64 `json:"metrics,omitempty"` OutputModuleHash string `json:"output_module_hash,omitempty"` //substreams-only field UserID string `json:"user_id"` ApiKeyID string `json:"api_key_id"` IpAddress string `json:"ip_address"` Meta string `json:"meta"` Timestamp time.Time `json:"timestamp"` }
func (Event) MarshalLogObject ¶
func (ev Event) MarshalLogObject(enc zapcore.ObjectEncoder) error
type EventEmitter ¶
func GetDefaultEmitter ¶
func GetDefaultEmitter() EventEmitter
type FactoryFunc ¶
type FactoryFunc func(config string, logger *zap.Logger) (EventEmitter, error)
type Meter ¶
type Meter interface { AddBytesWritten(n int) AddBytesRead(n int) AddBytesWrittenCtx(ctx context.Context, n int) AddBytesReadCtx(ctx context.Context, n int) BytesWritten() uint64 BytesRead() uint64 BytesWrittenDelta() uint64 BytesReadDelta() uint64 AddCounter(name string) CountInc(name string, n int) CountDec(name string, n int) GetCount(name string) int GetCountAndReset(name string) int ResetCount(name string) }
var NoopBytesMeter Meter = &noopMeter{}
func GetBytesMeter ¶
func NewBytesMeter ¶
func NewBytesMeter() Meter
type MeterLogData ¶
func (*MeterLogData) MarshalLogObject ¶
func (mld *MeterLogData) MarshalLogObject(enc zapcore.ObjectEncoder) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.