debugstat

package
v0.4.22 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CName = "common.debugstat"

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatableStatProvider

type AggregatableStatProvider interface {
	AggregateStat(stats []StatValue) any
}

type NoOpStatService

type NoOpStatService struct {
}

func (NoOpStatService) AddProvider

func (n NoOpStatService) AddProvider(provider StatProvider)

func (NoOpStatService) Close

func (n NoOpStatService) Close(ctx context.Context) (err error)

func (NoOpStatService) GetStat

func (n NoOpStatService) GetStat() StatSummary

func (NoOpStatService) Init

func (n NoOpStatService) Init(a *app.App) (err error)

func (NoOpStatService) Name

func (n NoOpStatService) Name() (name string)

func (NoOpStatService) RemoveProvider

func (n NoOpStatService) RemoveProvider(provider StatProvider)

func (NoOpStatService) Run

func (n NoOpStatService) Run(ctx context.Context) (err error)

type StatProvider

type StatProvider interface {
	ProvideStat() any
	StatId() string
	StatType() string
}

type StatService

type StatService interface {
	app.ComponentRunnable
	AddProvider(provider StatProvider)
	RemoveProvider(provider StatProvider)
	GetStat() StatSummary
}

func New

func New() StatService

func NewNoOp

func NewNoOp() StatService

type StatSummary

type StatSummary struct {
	Stats []StatType `json:"stat_types,omitempty"`
}

type StatType

type StatType struct {
	Type      string      `json:"type"`
	Values    []StatValue `json:"values,omitempty"`
	Aggregate any         `json:"aggregate,omitempty"`
}

type StatValue

type StatValue struct {
	Key   string `json:"key"`
	Value any    `json:"value"`
}

Directories

Path Synopsis
Package mock_debugstat is a generated GoMock package.
Package mock_debugstat is a generated GoMock package.

Jump to

Keyboard shortcuts

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