stats

package
v21.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RawMessageCount      = telemetry.Int64("raw_request_ct", "Raw request count", "1")
	RawMessagesSentCount = telemetry.Int64("raw_messages_sent_ct", "Raw messages sent count", "1")
	MessagesPostedCount  = telemetry.Int64("messages_posted_ct", "Messages posted count", "1")
	RawEventsCount       = telemetry.Int64("raw_events_ct", "Raw events count", "1")
	OpCodesCount         = telemetry.Int64("opcode_events_ct", "OpCode events count", "1")
)
View Source
var (
	TagStatus, _    = telemetry.NewTagKey("status")
	TagEventName, _ = telemetry.NewTagKey("event_name")
	TagOpCode, _    = telemetry.NewTagKey("op_code")
)
View Source
var (
	RawMessageCountView = &telemetry.View{
		Name:        "raw_requests",
		TagKeys:     []telemetry.TagKey{},
		Measure:     RawMessageCount,
		Description: "The number of raw messages received",
		Aggregation: telemetry.CountView(),
	}

	RawMessagesSentCountView = &telemetry.View{
		Name:        "raw_messages_sent",
		TagKeys:     []telemetry.TagKey{},
		Measure:     RawMessagesSentCount,
		Description: "The number of raw messages sent",
		Aggregation: telemetry.CountView(),
	}

	MessagesPostedCountView = &telemetry.View{
		Name: "messages_posted",
		TagKeys: []telemetry.TagKey{
			TagStatus,
		},
		Measure:     MessagesPostedCount,
		Description: "The number of messages posted to discord",
		Aggregation: telemetry.CountView(),
	}

	RawEventsCountView = &telemetry.View{
		Name: "raw_events",
		TagKeys: []telemetry.TagKey{
			TagEventName,
		},
		Measure:     RawEventsCount,
		Description: "The number of events processed by the messagehandler",
		Aggregation: telemetry.CountView(),
	}

	OpCodesCountView = &telemetry.View{
		Name: "opcode_events",
		TagKeys: []telemetry.TagKey{
			TagOpCode,
		},
		Measure:     OpCodesCount,
		Description: "The number of opcode events processed by the messagehandler",
		Aggregation: telemetry.CountView(),
	}
)

Functions

func Register

func Register() error

Types

type ActivityRecorder

type ActivityRecorder struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewActivityRecorder

func NewActivityRecorder(timescale float64) *ActivityRecorder

func (*ActivityRecorder) Avg

func (r *ActivityRecorder) Avg() float64

func (*ActivityRecorder) Incr

func (r *ActivityRecorder) Incr(v float64)

func (*ActivityRecorder) Run

func (r *ActivityRecorder) Run(ctx context.Context) error

func (*ActivityRecorder) Timescale

func (r *ActivityRecorder) Timescale() float64

Jump to

Keyboard shortcuts

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