statistics

package
v0.0.0-...-6789dc4 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: GPL-3.0, GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Statistics

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

func NewStatistics

func NewStatistics(logger logger.Logger) *Statistics

func (*Statistics) Accumulate

func (stats *Statistics) Accumulate()

func (*Statistics) DecreaseDevices

func (stats *Statistics) DecreaseDevices(device_name string, channel_name string)

func (*Statistics) GetStats

func (stats *Statistics) GetStats() *StatsData

func (*Statistics) IncreaseBroadcasts

func (stats *Statistics) IncreaseBroadcasts()

func (*Statistics) IncreaseDevices

func (stats *Statistics) IncreaseDevices(device_name string, channel_name string)

func (*Statistics) IncreaseUnicasts

func (stats *Statistics) IncreaseUnicasts()

func (*Statistics) PrintStats

func (stats *Statistics) PrintStats()

Shall be called periodically (every 5 minutes) to output stats

func (*Statistics) Reset5min

func (stats *Statistics) Reset5min()

func (*Statistics) StatsValueToStatsDataValue

func (stats *Statistics) StatsValueToStatsDataValue(statsValue *StatsValue) *StatsDataValue

func (*Statistics) TestStats

func (stats *Statistics) TestStats()

type StatsData

type StatsData struct {
	DevicesOnline   *StatsDataValue         `json:"devicesOnline"`
	UnicastsTotal   *StatsDataValue         `json:"unicastsTotal"`
	BroadcastsTotal *StatsDataValue         `json:"broadcastsTotal"`
	Devices         *[]StatsDataDetailValue `json:"devices"`
	Channels        *[]StatsDataDetailValue `json:"channels"`
}

type StatsDataDetailValue

type StatsDataDetailValue struct {
	Key    string          `json:"type"`
	Values *StatsDataValue `json:"data"`
}

type StatsDataValue

type StatsDataValue struct {
	Val5min  int32 `json:"5min"`
	Val60min int32 `json:"60min"`
	Val1day  int32 `json:"1day"`
	Val7day  int32 `json:"7day"`
}

type StatsValue

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

func NewStatsValue

func NewStatsValue() *StatsValue

func (*StatsValue) Accumulate

func (statsvalue *StatsValue) Accumulate()

func (*StatsValue) Report

func (statsvalue *StatsValue) Report() (int32, int32, int32, int32)

func (*StatsValue) Reset5min

func (statsvalue *StatsValue) Reset5min()

Jump to

Keyboard shortcuts

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