stats

package
v0.0.0-...-4a56adb Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Total         int `json:"total"`
	Updated24hAgo int `json:"updated_24h_ago"`
}

type Stats

type Stats struct {
	Uptime       float32   `json:"uptime_ms"`
	UpdateTime   string    `json:"update_time"`
	StartTime    time.Time `json:"-"`
	Chassis      UnitStats `json:"chassis"`
	Blade        UnitStats `json:"blades"`
	Discrete     UnitStats `json:"discretes"`
	Nic          UnitStats `json:"nics"`
	StorageBlade UnitStats `json:"storage_blades"`
	ScannedPort  UnitStats `json:"scanned_ports"`
	Psu          UnitStats `json:"psus"`
	Disk         UnitStats `json:"disks"`
	Fan          UnitStats `json:"fans"`
}

func (*Stats) GatherDBStats

func (s *Stats) GatherDBStats(
	chassisStorage *storage.ChassisStorage,
	bladeStorage *storage.BladeStorage,
	discreteStorage *storage.DiscreteStorage,
	nicStorage *storage.NicStorage,
	storageBladeStorage *storage.StorageBladeStorage,
	scannedPortStorage *storage.ScannedPortStorage,
	psuStorage *storage.PsuStorage,
	diskStorage *storage.DiskStorage,
	fanStorage *storage.FanStorage)

GatherDBStats triggers GatherDBStats function from all resources types

func (*Stats) UpdateUptime

func (s *Stats) UpdateUptime()

UpdateUptime updates uptime based on StartTime

type UnitStats

type UnitStats struct {
	Asset
	Vendors map[string]Asset `json:"by_vendor"`
}

Jump to

Keyboard shortcuts

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