stats

package
v0.0.0-...-a34aaee Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package stats implements statistics collection and reporting. It is used by server to report internal statistics, such as number of requests and responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONStats

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

JSONStats is what we want to report as stats via http

func NewJSONStats

func NewJSONStats() *JSONStats

NewJSONStats returns a new JSONStats

func (*JSONStats) DecRX

func (s *JSONStats) DecRX(t ptp.MessageType)

DecRX atomically removes 1 from the counter

func (*JSONStats) DecRXSignaling

func (s *JSONStats) DecRXSignaling(t ptp.MessageType)

DecRXSignaling atomically removes 1 from the counter

func (*JSONStats) DecSubscription

func (s *JSONStats) DecSubscription(t ptp.MessageType)

DecSubscription atomically removes 1 from the counter

func (*JSONStats) DecTX

func (s *JSONStats) DecTX(t ptp.MessageType)

DecTX atomically removes 1 from the counter

func (*JSONStats) DecTXSignaling

func (s *JSONStats) DecTXSignaling(t ptp.MessageType)

DecTXSignaling atomically removes 1 from the counter

func (*JSONStats) DecWorkerSubs

func (s *JSONStats) DecWorkerSubs(workerid int)

DecWorkerSubs atomically removes 1 from the counter

func (*JSONStats) IncRX

func (s *JSONStats) IncRX(t ptp.MessageType)

IncRX atomically add 1 to the counter

func (*JSONStats) IncRXSignaling

func (s *JSONStats) IncRXSignaling(t ptp.MessageType)

IncRXSignaling atomically add 1 to the counter

func (*JSONStats) IncSubscription

func (s *JSONStats) IncSubscription(t ptp.MessageType)

IncSubscription atomically add 1 to the counter

func (*JSONStats) IncTX

func (s *JSONStats) IncTX(t ptp.MessageType)

IncTX atomically add 1 to the counter

func (*JSONStats) IncTXSignaling

func (s *JSONStats) IncTXSignaling(t ptp.MessageType)

IncTXSignaling atomically add 1 to the counter

func (*JSONStats) IncWorkerSubs

func (s *JSONStats) IncWorkerSubs(workerid int)

IncWorkerSubs atomically add 1 to the counter

func (*JSONStats) Reset

func (s *JSONStats) Reset()

Reset atomically sets all the counters to 0

func (*JSONStats) SetMaxTXTSAttempts

func (s *JSONStats) SetMaxTXTSAttempts(workerid int, attempts int64)

SetMaxTXTSAttempts atomically sets number of retries for get latest TX timestamp

func (*JSONStats) SetMaxWorkerQueue

func (s *JSONStats) SetMaxWorkerQueue(workerid int, queue int64)

SetMaxWorkerQueue atomically sets worker queue len

func (*JSONStats) SetUTCOffset

func (s *JSONStats) SetUTCOffset(utcoffset int64)

SetUTCOffset atomically sets the utcoffset

func (*JSONStats) Snapshot

func (s *JSONStats) Snapshot()

Snapshot the values so they can be reported atomically

func (*JSONStats) Start

func (s *JSONStats) Start(monitoringport int)

Start runs http server and initializes maps

type Stats

type Stats interface {
	// Start starts a stat reporter
	// Use this for passive reporters
	Start(monitoringport int)

	// Snapshot the values so they can be reported atomically
	Snapshot()

	// Reset atomically sets all the counters to 0
	Reset()

	// IncSubscription atomically add 1 to the counter
	IncSubscription(t ptp.MessageType)

	// IncRX atomically add 1 to the counter
	IncRX(t ptp.MessageType)

	// IncTX atomically add 1 to the counter
	IncTX(t ptp.MessageType)

	// IncRXSignaling atomically add 1 to the counter
	IncRXSignaling(t ptp.MessageType)

	// IncTXSignaling atomically add 1 to the counter
	IncTXSignaling(t ptp.MessageType)

	// IncWorkerSubs atomically add 1 to the counter
	IncWorkerSubs(workerid int)

	// DecSubscription atomically removes 1 from the counter
	DecSubscription(t ptp.MessageType)

	// DecRX atomically removes 1 from the counter
	DecRX(t ptp.MessageType)

	// DecTX atomically removes 1 from the counter
	DecTX(t ptp.MessageType)

	// DecRXSignaling atomically removes 1 from the counter
	DecRXSignaling(t ptp.MessageType)

	// DecTXSignaling atomically removes 1 from the counter
	DecTXSignaling(t ptp.MessageType)

	// DecWorkerSubs atomically removes 1 from the counter
	DecWorkerSubs(workerid int)

	// SetMaxWorkerQueue atomically sets worker queue len
	SetMaxWorkerQueue(workerid int, queue int64)

	// SetMaxTXTSAttempts atomically sets number of retries for get latest TX timestamp
	SetMaxTXTSAttempts(workerid int, retries int64)

	// SetUTCOffset atomically sets the utcoffset
	SetUTCOffset(utcoffset int64)
}

Stats is a metric collection interface

Jump to

Keyboard shortcuts

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