types

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KiB = BiB(1024)
	MiB = BiB(1024 * 1024)
	GiB = BiB(1024 * 1024 * 1024)
	TiB = BiB(1024 * 1024 * 1024 * 1024)
)

Variables

This section is empty.

Functions

func PercentileOf

func PercentileOf(seq []float64, x float64) float64

Approximate percentile value for threshold X

Types

type AvailabilityZones

type AvailabilityZones []string

Availability Zones Node is deployed to

func (AvailabilityZones) String

func (v AvailabilityZones) String() string

type BiB

type BiB uint

Binary Storage Unit

func (BiB) String

func (v BiB) String() string

type CPU

type CPU struct {
	Cores int `json:"cores"`
	Clock GHz `json:"clock"`
}

CPU specification

func (CPU) String

func (v CPU) String() string

type Cluster

type Cluster struct {
	ID     string  `json:"id"`
	Engine *Engine `json:"engine,omitempty"`
	Reader []Node  `json:"reader,omitempty"`
	Writer []Node  `json:"writer,omitempty"`
}

DB cluster topology

type Compute

type Compute struct {
	CPU    *CPU     `json:"cpu,omitempty"`
	Memory *Storage `json:"memory,omitempty"`
}

Compute resource

func (Compute) String

func (v Compute) String() string

type Engine

type Engine struct {
	ID      string `json:"id"`
	Version string `json:"version"`
}

Database engine specification

func (Engine) String

func (v Engine) String() string

type GHz

type GHz float64

Frequency data type

func (GHz) String

func (v GHz) String() string

type MinMax

type MinMax struct {
	Min, Avg, Max float64
}

func NewMinMax

func NewMinMax(min, avg, max []float64) MinMax

func NewMinMaxSoft

func NewMinMaxSoft(min, avg, max []float64) MinMax

func (MinMax) MarshalJSON

func (x MinMax) MarshalJSON() ([]byte, error)

func (MinMax) String

func (x MinMax) String() string

type Node

type Node struct {
	ID       string            `json:"id"`
	Name     string            `json:"name"`
	Type     string            `json:"type"`
	Zones    AvailabilityZones `json:"zones"`
	Engine   *Engine           `json:"engine,omitempty"`
	Storage  *Storage          `json:"storage,omitempty"`
	Compute  *Compute          `json:"compute,omitempty"`
	ReadOnly bool              `json:"readonly"`
}

Cluster Node

func (Node) String

func (v Node) String() string

type Percentile

type Percentile struct {
	P50  float64 `json:"p50"`
	P95  float64 `json:"p95"`
	P99  float64 `json:"p99"`
	P999 float64 `json:"p999"`
}

func NewPercentile

func NewPercentile(seq []float64) Percentile

func (Percentile) MarshalJSON

func (x Percentile) MarshalJSON() ([]byte, error)

func (Percentile) String

func (x Percentile) String() string

type Region

type Region struct {
	Clusters []Cluster
	Nodes    []Node
}

Region topology

type Rule

type Rule struct {
	ID    string `json:"id,omitempty"`
	Unit  string `json:"unit,omitempty"`
	About string `json:"about,omitempty"`
}

func (Rule) String

func (v Rule) String() string

type Status

type Status struct {
	Code        StatusCode    `json:"status"`
	Rule        Rule          `json:"rule"`
	Interval    time.Duration `json:"-"`
	SuccessRate *float64      `json:"success_rate,omitempty"`
	HardMM      *MinMax       `json:"hard_minmax,omitempty"`
	SoftMM      *MinMax       `json:"soft_minmax,omitempty"`
	Aggregator  *string       `json:"aggregator,omitempty"`
	Percentile  *Percentile   `json:"distribution,omitempty"`
}

Status of rule evaluation

func (Status) MarshalJSON

func (v Status) MarshalJSON() ([]byte, error)

func (Status) String

func (v Status) String() string

type StatusCluster

type StatusCluster struct {
	Status  StatusCode
	Cluster *Cluster
	Writer  []StatusNode
	Reader  []StatusNode
}

type StatusCode

type StatusCode int
const (
	STATUS_CODE_UNKNOWN StatusCode = iota
	STATUS_CODE_SUCCESS
	STATUS_CODE_WARNING
	STATUS_CODE_FAILURE
)

func (StatusCode) MarshalJSON

func (code StatusCode) MarshalJSON() ([]byte, error)

func (StatusCode) String

func (v StatusCode) String() string

type StatusNode

type StatusNode struct {
	Status StatusCode `json:"code,omitempty"`
	Node   *Node      `json:"node,omitempty"`
	Checks []Status   `json:"status,omitempty"`
}

func (StatusNode) String

func (v StatusNode) String() string

type StatusRegion

type StatusRegion struct {
	Status   StatusCode
	Clusters []StatusCluster
	Nodes    []StatusNode
}

func (StatusRegion) String

func (v StatusRegion) String() string

type Storage

type Storage struct {
	Type string `json:"type"`
	Size BiB    `json:"size"`
}

Storage specification

func (Storage) String

func (v Storage) String() string

Jump to

Keyboard shortcuts

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