report

package
v0.13.5 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package report contains primitives for reporting the results of an experiment. It supports text and HTML report formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTMLReporter

type HTMLReporter struct {
	// Reporter enables access to all reporter data and methods
	*Reporter
}

HTMLReporter supports generation of HTML reports from experiments.

func (*HTMLReporter) Gen

func (ht *HTMLReporter) Gen(out io.Writer) error

Gen creates an HTML report for a given experiment

func (*HTMLReporter) MetricDescriptionHTML

func (ht *HTMLReporter) MetricDescriptionHTML(metricName string) (string, error)

MetricDescriptionHTML is used to described metrics in the metrics and SLO section of the HTML report

func (*HTMLReporter) RenderStr

func (ht *HTMLReporter) RenderStr(what string) (string, error)

RenderStr is a helper method for rendering strings Used in HTML template

func (*HTMLReporter) SortedVectorMetrics

func (ht *HTMLReporter) SortedVectorMetrics() []string

SortedVectorMetrics extracts vector metric names from experiment in sorted order

func (*HTMLReporter) VectorMetricValue

func (ht *HTMLReporter) VectorMetricValue(i int, m string) []float64

VectorMetricValue gets the value of the given vector metric for the given version If it is a histogram metric, then its values are sampled from the histogram Recall: VectorMetric can be a histogram metric or a sample metric.

type Reporter

type Reporter struct {
	// Experiment enables access to all base.Experiment data and methods
	*base.Experiment
}

Reporter implements methods that are common to text and HTML reporting.

func (*Reporter) MetricWithUnits

func (r *Reporter) MetricWithUnits(metricName string) (string, error)

MetricWithUnits provides the string representation of a metric name with units

func (*Reporter) ScalarMetricValueStr

func (r *Reporter) ScalarMetricValueStr(j int, mn string) string

ScalarMetricValueStr extracts value of a scalar metric (mn) for the given app version (j) Value is converted to string so that it can be printed in text and HTML reports.

func (*Reporter) SortedScalarAndSLOMetrics

func (r *Reporter) SortedScalarAndSLOMetrics() []string

SortedScalarAndSLOMetrics extracts and sorts metric names from experiment. It looks for scalar metrics referenced in the MetricsInfo section, and also for scalar metrics referenced in SLOs.

type TextReporter

type TextReporter struct {
	// Reporter is embedded and enables access to all reporter data and methods
	*Reporter
}

TextReporter supports generation of text reports from experiments.

func (*TextReporter) Gen

func (tr *TextReporter) Gen(out io.Writer) error

Gen writes the text report for a given experiment into the given writer

func (*TextReporter) PrintMetricsText

func (tr *TextReporter) PrintMetricsText() string

PrintMetricsText returns metrics section of the text report as a string

func (*TextReporter) PrintSLOsText

func (tr *TextReporter) PrintSLOsText() string

PrintSLOsText returns SLOs section of the text report as a string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳