stats

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

type Stats struct {
	Version               string        `json:"version"`
	Build                 string        `json:"build"`
	OS                    string        `json:"os"`
	ARCH                  string        `json:"os_arch"`
	GoVersion             string        `json:"go_version"`
	ProcessID             int           `json:"process_id"`
	TCPHost               string        `json:"tcp_host"`
	TCPPort               int           `json:"tcp_port"`
	Uptime                time.Duration `json:"server_uptime"`
	UptimeHuman           string        `json:"server_uptime_human"`
	ConnectedCount        uint64        `json:"connected_clients"`
	TotalConnectionsCount uint64        `json:"total_connections_count"`
	MemoryUsage           uint64        `json:"memory_usage"`
	MemoryUsageHuman      string        `json:"memory_usage_human"`
	MemoryTotalAlloc      uint64        `json:"memory_total_alloc"`
}

Stats stores the information of the kvstore server

func (*Stats) Init

func (s *Stats) Init()

Init sets the default values

func (*Stats) JSON

func (s *Stats) JSON() ([]byte, error)

JSON returns the json representation of this struct

func (*Stats) UpdateMemStats

func (s *Stats) UpdateMemStats()

UpdateMemStats updates the MemoryUsage, MemoryUsageHuman and MemoryTotalAlloc fields with the current memory usage, and total allocations

func (*Stats) UpdateUptime

func (s *Stats) UpdateUptime()

UpdateUptime updates the Uptime and UptimeHuman fields to the current time

Jump to

Keyboard shortcuts

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