stats

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MPL-2.0 Imports: 9 Imported by: 87

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_app_stats_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

Channel is an implementation of stats.Channel.

func NewChannel

func NewChannel(config *ChannelConfig) *Channel

NewChannel creates an instance of Statistics Channel.

func (*Channel) Close

func (c *Channel) Close() error

Close implements common.Closable.

func (*Channel) Publish

func (c *Channel) Publish(ctx context.Context, msg interface{})

Publish implements stats.Channel.

func (*Channel) Running

func (c *Channel) Running() bool

Running returns whether the channel is running.

func (*Channel) Start

func (c *Channel) Start() error

Start implements common.Runnable.

func (*Channel) Subscribe

func (c *Channel) Subscribe() (chan interface{}, error)

Subscribe implements stats.Channel.

func (*Channel) Subscribers

func (c *Channel) Subscribers() []chan interface{}

Subscribers implements stats.Channel.

func (*Channel) Unsubscribe

func (c *Channel) Unsubscribe(subscriber chan interface{}) error

Unsubscribe implements stats.Channel.

type ChannelConfig

type ChannelConfig struct {
	Blocking        bool  `protobuf:"varint,1,opt,name=Blocking,proto3" json:"Blocking,omitempty"`
	SubscriberLimit int32 `protobuf:"varint,2,opt,name=SubscriberLimit,proto3" json:"SubscriberLimit,omitempty"`
	BufferSize      int32 `protobuf:"varint,3,opt,name=BufferSize,proto3" json:"BufferSize,omitempty"`
	// contains filtered or unexported fields
}

func (*ChannelConfig) Descriptor deprecated

func (*ChannelConfig) Descriptor() ([]byte, []int)

Deprecated: Use ChannelConfig.ProtoReflect.Descriptor instead.

func (*ChannelConfig) GetBlocking

func (x *ChannelConfig) GetBlocking() bool

func (*ChannelConfig) GetBufferSize

func (x *ChannelConfig) GetBufferSize() int32

func (*ChannelConfig) GetSubscriberLimit

func (x *ChannelConfig) GetSubscriberLimit() int32

func (*ChannelConfig) ProtoMessage

func (*ChannelConfig) ProtoMessage()

func (*ChannelConfig) ProtoReflect

func (x *ChannelConfig) ProtoReflect() protoreflect.Message

func (*ChannelConfig) Reset

func (x *ChannelConfig) Reset()

func (*ChannelConfig) String

func (x *ChannelConfig) String() string

type Config

type Config struct {
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

Counter is an implementation of stats.Counter.

func (*Counter) Add

func (c *Counter) Add(delta int64) int64

Add implements stats.Counter.

func (*Counter) Set

func (c *Counter) Set(newValue int64) int64

Set implements stats.Counter.

func (*Counter) Value

func (c *Counter) Value() int64

Value implements stats.Counter.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is an implementation of stats.Manager.

func NewManager

func NewManager(ctx context.Context, config *Config) (*Manager, error)

NewManager creates an instance of Statistics Manager.

func (*Manager) Close

func (m *Manager) Close() error

Close implement common.Closable.

func (*Manager) GetChannel

func (m *Manager) GetChannel(name string) stats.Channel

GetChannel implements stats.Manager.

func (*Manager) GetCounter

func (m *Manager) GetCounter(name string) stats.Counter

GetCounter implements stats.Manager.

func (*Manager) RegisterChannel

func (m *Manager) RegisterChannel(name string) (stats.Channel, error)

RegisterChannel implements stats.Manager.

func (*Manager) RegisterCounter

func (m *Manager) RegisterCounter(name string) (stats.Counter, error)

RegisterCounter implements stats.Manager.

func (*Manager) Start

func (m *Manager) Start() error

Start implements common.Runnable.

func (*Manager) Type

func (*Manager) Type() interface{}

Type implements common.HasType.

func (*Manager) UnregisterChannel

func (m *Manager) UnregisterChannel(name string) error

UnregisterChannel implements stats.Manager.

func (*Manager) UnregisterCounter

func (m *Manager) UnregisterCounter(name string) error

UnregisterCounter implements stats.Manager.

func (*Manager) VisitCounters

func (m *Manager) VisitCounters(visitor func(string, stats.Counter) bool)

VisitCounters calls visitor function on all managed counters.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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