cireport

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageReportCLI

func ImageReportCLI(cfg config.ImageReport) (string, error)

func NewFsWriter

func NewFsWriter() *fs

func NewImageReporter

func NewImageReporter(screenshotter GrafanaScreenshotter, uploader Uploader) *imageReporter

func NewMetaReport

func NewMetaReport(allowlist []string) (*metaReport, error)

NewMetaReport creates a meta report the allowlist parameter refers to which keys are valid

func NewS3Writer

func NewS3Writer(bucketName string) (*s3Writer, error)

NewS3Writer creates a s3 it assumes AWS environment variables are setup correctly

func NewTableReport

func NewTableReport(q Querier) *tableReport

func TableReportCli

func TableReportCli(q Querier, queriesFile string) (string, error)

Types

type DashboardScreenshotter

type DashboardScreenshotter interface {
	AllPanels(ctx context.Context, dashboardUID string, from int64, to int64) ([]Panel, error)
}

type GrafanaScreenshotter

type GrafanaScreenshotter struct {
	GrafanaURL     string
	TimeoutSeconds int
}

func (*GrafanaScreenshotter) AllPanels

func (gs *GrafanaScreenshotter) AllPanels(ctx context.Context, dashboardUID string, from int64, to int64) ([]Panel, error)

AllPanes take a screenshot of all panes in a dashboard

func (*GrafanaScreenshotter) ScreenshotPanel

func (gs *GrafanaScreenshotter) ScreenshotPanel(ctx context.Context, cfg ScreenshotPanelConfig) ([]byte, error)

ScreenshotPanel takes screenshot of a grafana panel

type Panel

type Panel struct {
	ID    int    `json:"id"`
	Title string `json:"title"`
	Type  string `json:"type"`
	Data  []byte
}

type Querier

type Querier interface {
	Instant(query string, t time.Time) (float64, error)
}

type QueriesConfig

type QueriesConfig struct {
	BaseName   string `yaml:"baseName"`
	TargetName string `yaml:"targetName"`

	Queries []Query `yaml:"queries"`
}

type Query

type Query struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description" default:""`

	Base         string `yaml:"base"`
	BaseResult   float64
	Target       string `yaml:"target"`
	TargetResult float64
	// TODO(eh-am): implement a default value
	DiffThreshold float64 `yaml:"diffThresholdPercent"`
	DiffPercent   float64

	BiggerIsBetter bool `yaml:"biggerIsBetter"`
	// contains filtered or unexported fields
}

type Row

type Row struct {
	Panels []Panel `json:"panels"`
}

type ScreenshotPanelConfig

type ScreenshotPanelConfig struct {
	DashboardUID string
	PanelId      int
	From         int64
	To           int64
	Width        int
	Height       int
}

type Uploader

type Uploader interface {
	WriteFile(dest string, data []byte) (string, error)
}

Jump to

Keyboard shortcuts

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