archive

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPath

func GetPath(start time.Time, end time.Time, dataDir string, hostname string) string

GetPath returns a filesystem path where an archive should be written.

func MustMarshalJSON

func MustMarshalJSON(m Model) []byte

MustMarshalJSON accepts a Model object and returns marshalled JSON.

func Write

func Write(archivePath string, data []byte) error

Write writes out JSON data to a file on disk.

Types

type Model

type Model struct {
	Experiment string   `json:"experiment"`
	Hostname   string   `json:"hostname"`
	Metric     string   `json:"metric"`
	Samples    []Sample `json:"sample"`
}

Model represents the structure of metric for DISCO.

type Sample

type Sample struct {
	Timestamp    int64  `json:"timestamp"`
	CollectStart int64  `json:"collectstart"`
	CollectEnd   int64  `json:"collectend"`
	Value        uint64 `json:"value"`
	Counter      uint64 `json:"counter"`
}

Sample represents the basic structure for metric samples.

Jump to

Keyboard shortcuts

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