report

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(format Format, r *Report, w io.Writer, l *logrus.Logger)

Write - write report based on given format

Types

type Format

type Format string

Format - type used to set supported report formats

const (
	JSON       Format = "json"
	TABBED     Format = "tabbed"
	SimpleText Format = "simple"
)

Define supported formats

type Report

type Report struct {
	APIVersion   string        `json:"api_version"`
	Timestamp    time.Time     `json:"timestamp"`
	Dependencies []string      `json:"dependencies"`
	ServiceLevel *ServiceLevel `json:"service_level"`

	// TODO: decide whether this should be implemented as
	// Observation Windor or Boundary
	ObservationWindow Window `json:"window"`
}

func FromManifest

func FromManifest(m *manifest.Manifest) (*Report, error)

type ServiceLevel

type ServiceLevel struct {
	Target *ServiceLevelIndicators `json:"target"`
	Actual *ServiceLevelIndicators `json:"actual"`
	Delta  *ServiceLevelIndicators `json:"delta"`
}

type ServiceLevelIndicators

type ServiceLevelIndicators struct {
	ErrorPercent float64 `json:"error_percent"`
	LatencyMs    int64   `json:"latency_ms"`
}

type Window

type Window struct {
	From time.Time `json:"from"`
	To   time.Time `json:"to"`
}

Jump to

Keyboard shortcuts

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