report

package
v6.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package report implements the `report` commands: time series over the tenant, printed as the platform sends them.

Index

Constants

This section is empty.

Variables

View Source
var Kinds = []Kind{
	{Name: "users", Short: "Users in the tenant over time.", /* contains filtered or unexported fields */},
	{Name: "teams", Short: "Teams in the tenant over time.", /* contains filtered or unexported fields */},
	{Name: "environments", Short: "Environments in the tenant over time.", /* contains filtered or unexported fields */},
	{
		Name: "experiments-executed", Short: "Experiment runs over time.", Filters: Teams | Environments | Services,
		GroupBy: []string{"NONE", "STATE", "TRIGGER", "ACTION", "ISSUES_FIXED", "ISSUES_DISCOVERED"},
		// contains filtered or unexported fields
	},
	{
		Name: "experiments-created", Short: "Experiments created over time.", Filters: Teams | Environments,
		GroupBy: []string{"NONE", "CREATED_VIA", "ORIGIN"},
		// contains filtered or unexported fields
	},
	{Name: "services-distribution", Short: "Services per risk level (low, medium, high) over time.", Filters: serviceFilters, /* contains filtered or unexported fields */},
	{Name: "services-by-category", Short: "The average risk of services per category over time.", Filters: serviceFilters, /* contains filtered or unexported fields */},
	{Name: "services-average", Short: "The average risk of services, 0 to 100, over time.", Filters: serviceFilters, /* contains filtered or unexported fields */},
}
View Source
var Today = func() time.Time { return time.Now().UTC() }

Today is when a report ends by default. A variable, so that tests can fix it.

Functions

func Run

func Run(ctx context.Context, c *platform.Client, k Kind, o Options) error

Types

type Filter

type Filter int

Filter says which filters a report takes beyond the time range.

const (
	Teams Filter = 1 << iota
	Environments
	Services
	ServiceProperties
	Categories
)

type Kind

type Kind struct {
	Name, Short string
	Filters     Filter
	// The groupings the report offers; none means it cannot be grouped.
	GroupBy []string
	// contains filtered or unexported fields
}

func (Kind) Takes

func (k Kind) Takes(f Filter) bool

type Options

type Options struct {
	From, To, Rollup, GroupBy string
	// Teams by key and environments by name, as users know them; the platform takes ids.
	Teams, Environments, Services, Categories []string
	ServiceProperties                         []string
	File, Type                                string
}

Jump to

Keyboard shortcuts

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