stats

package
v0.0.0-...-35cc90c Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONStats

type JSONStats struct {
	Stats
}

JSONStats is what we want to report as stats via http

func NewJSONStats

func NewJSONStats() *JSONStats

NewJSONStats returns a new JSONStats

func (*JSONStats) Start

func (s *JSONStats) Start(monitoringport int)

Start runs http server and initializes maps

type Server

type Server interface {
	// Reset atomically sets all the counters to 0
	Reset()
	SetCounter(key string, val int64)
	UpdateCounterBy(key string, count int64)
}

Server is a stats server interface

type Stats

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

Stats is an implementation of

func NewStats

func NewStats() *Stats

NewStats created new instance of Stats

func (Stats) Copy

func (s Stats) Copy(dst *Stats)

Copy all key-values between maps

func (Stats) Get

func (s Stats) Get() map[string]int64

Get returns an map of counters

func (Stats) Reset

func (s Stats) Reset()

Reset all the values of counters

func (Stats) SetCounter

func (s Stats) SetCounter(key string, val int64)

SetCounter will set a counter to the provided value.

func (Stats) UpdateCounterBy

func (s Stats) UpdateCounterBy(key string, count int64)

UpdateCounterBy will increment counter

Jump to

Keyboard shortcuts

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