statistics

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(cfw inter.Framework, handler http.Handler)

Start starts serving exp stats and metrics on the configured statistics port

Types

type BuildInfo added in v0.19.0

type BuildInfo struct {
	Version          string `json:"version"`
	SHA              string `json:"sha"`
	BuildDate        string `json:"build_date"`
	License          string `json:"license"`
	TLS              bool   `json:"tls"`
	Secure           bool   `json:"secure"`
	Go               string `json:"go"`
	MaxBrokerClients int    `json:"max_broker_clients"`
}

type ChoriaInfo added in v0.19.0

type ChoriaInfo struct {
	Build      BuildInfo `json:"build"`
	System     SysInfo   `json:"system"`
	ConfigFile string    `json:"config_file"`
	Identity   string    `json:"identity"`
}

func SystemInfo added in v0.19.0

func SystemInfo() ChoriaInfo

type InstanceStatus added in v0.19.0

type InstanceStatus struct {
	Identity           string       `json:"identity"`
	Uptime             int64        `json:"uptime"`
	ConnectedServer    string       `json:"connected_server"`
	LastMessage        int64        `json:"last_message"`
	Provisioning       bool         `json:"provisioning_mode"`
	Stats              *ServerStats `json:"stats"`
	CertificateExpires time.Time    `json:"certificate_expires"`
	TokenExpires       time.Time    `json:"token_expires"`
	FileName           string       `json:"-"`
	ModTime            time.Time    `json:"-"`
}

InstanceStatus describes the current instance status

func LoadInstanceStatus added in v0.19.0

func LoadInstanceStatus(f string) (*InstanceStatus, error)

func (*InstanceStatus) CheckCertValidity added in v0.23.0

func (i *InstanceStatus) CheckCertValidity(tillExpire time.Duration) error

func (*InstanceStatus) CheckConnection added in v0.19.0

func (i *InstanceStatus) CheckConnection() error

CheckConnection checks if the server is currently connected

func (*InstanceStatus) CheckFileAge added in v0.19.0

func (i *InstanceStatus) CheckFileAge(maxAge time.Duration) error

func (*InstanceStatus) CheckLastMessage added in v0.19.0

func (i *InstanceStatus) CheckLastMessage(maxAge time.Duration) error

func (*InstanceStatus) CheckTokenValidity added in v0.25.0

func (i *InstanceStatus) CheckTokenValidity(tillExpire time.Duration) error

type ServerStats added in v0.19.0

type ServerStats struct {
	Total      int64 `json:"total"`
	Valid      int64 `json:"valid"`
	Invalid    int64 `json:"invalid"`
	Passed     int64 `json:"passed"`
	Filtered   int64 `json:"filtered"`
	Replies    int64 `json:"replies"`
	TTLExpired int64 `json:"ttlexpired"`
	Events     int64 `json:"events"`
}

ServerStats are internal statistics about the running server

type SysInfo added in v0.19.0

type SysInfo struct {
	RSS   int64   `json:"rss"`
	PCPU  float64 `json:"cpu_percent"`
	Cores int     `json:"cpu_cores"`
}

Jump to

Keyboard shortcuts

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