parser

package
v0.0.0-...-3c1d385 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Hostname    string          `json:"hostname"`
	CPU         ServerAttribute `json:"cpu_load"`
	MemorySize  ServerAttribute `json:"memory_size"`
	MemoryUsage ServerAttribute `json:"memory_usage"`
	DiskSize    ServerAttribute `json:"disk_size"`
	DiskUsage   ServerAttribute `json:"disk_usage"`
}

Server is the abstraction of the server object inside a JSON.

type ServerAttribute

type ServerAttribute struct {
	Unit  string
	Value float64
}

ServerAttribute is a server attribute which is encoded in JSON

type ServerCollection

type ServerCollection map[string]*ServerData

ServerCollection maps the hostname of a server to its telemetry data

func Parse

func Parse(folder string) (ServerCollection, error)

Parse reads a folder of JSON files, processing its contents into a ServerCollection.

type ServerData

type ServerData struct {
	CPU         []float64
	MemorySize  float64
	MemoryUsage []float64
	DiskSize    float64
	DiskUsage   []float64

	CPUStats struct {
		Mean float64
		Mode []float64
	}

	MemoryStats struct {
		Mean float64
		Mode []float64
	}

	DiskStats struct {
		Mean float64
		Mode []float64
	}

	Usage float64
}

ServerData ...

Jump to

Keyboard shortcuts

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