Documentation ¶
Overview ¶
Package summarizer provides a method to read state protos defined in a config an output summary protos.
Index ¶
- Constants
- func CalculateHealthiness(grid *statepb.Grid, startTime int, endTime int, tab string) *summarypb.HealthinessInfo
- func CalculateTrend(currentHealthiness, previousHealthiness *summarypb.HealthinessInfo)
- func ReadSummary(ctx context.Context, client gcs.Client, path gcs.Path) (*summarypb.DashboardSummary, time.Time, int64, error)
- func SummaryPath(g gcs.Path, prefix, dashboard string) (*gcs.Path, error)
- func Update(ctx context.Context, client gcs.ConditionalClient, mets *Metrics, ...) error
- type FeatureFlags
- type Fixer
- type Metrics
- type UpdateOptions
Constants ¶
const (
// DefaultInterval is the default number of days of analysis
DefaultInterval = 7
)
Variables ¶
This section is empty.
Functions ¶
func CalculateHealthiness ¶ added in v0.0.13
func CalculateHealthiness(grid *statepb.Grid, startTime int, endTime int, tab string) *summarypb.HealthinessInfo
CalculateHealthiness extracts the test run data from each row (which represents a test) of the Grid and then analyzes it with an implementation of flakinessAnalyzer, which has implementations in the subdir naive and can be injected as needed.
func CalculateTrend ¶ added in v0.0.14
func CalculateTrend(currentHealthiness, previousHealthiness *summarypb.HealthinessInfo)
CalculateTrend populates the ChangeFromLastInterval fields of each TestInfo by comparing the current flakiness to the flakiness calculated for the last interval. Interval length is a config value that is 7 days by default. The Trend enum defaults to UNKNOWN, so there is no need to explicitly assign UNKNOWN when a test appears in currentHealthiness but not in previousHealthiness.
func ReadSummary ¶ added in v0.0.155
func ReadSummary(ctx context.Context, client gcs.Client, path gcs.Path) (*summarypb.DashboardSummary, time.Time, int64, error)
ReadSummary provides the dashboard summary as defined in summary.proto. IMPORTANT: Returns nil if the object doesn't exist. Returns an error iff wasn't read or serialized properly.
func SummaryPath ¶ added in v0.0.155
SummaryPath generates a summary GCS path for a given dashboard
func Update ¶
func Update(ctx context.Context, client gcs.ConditionalClient, mets *Metrics, opts *UpdateOptions, fixers ...Fixer) error
Update summary protos by reading the state protos defined in the config.
Will use concurrency go routines to update dashboards in parallel. Setting dashboard will limit update to this dashboard. Will write summary proto when confirm is set.
Types ¶
type FeatureFlags ¶ added in v0.0.149
type FeatureFlags struct { // controls the acceptable flakiness calculation logic for dashboard tab AllowFuzzyFlakiness bool // allows ignoring columns with specific test statuses during summarization AllowIgnoredColumns bool // allows enforcing minimum number of runs for a dashboard tab AllowMinNumberOfRuns bool }
FeatureFlags aggregates the knobs to enable/disable certain features.
type Fixer ¶ added in v0.0.108
type Fixer func(context.Context, *config.DashboardQueue) error
Fixer should adjust the dashboard queue until the context expires.
func FixGCS ¶ added in v0.0.108
func FixGCS(client pubsub.Subscriber, log logrus.FieldLogger, projID, subID string, configPath gcs.Path, tabPathPrefix string) (Fixer, error)
FixGCS listens for GCS changes to test groups and schedules another update of its dashboards ~immediately.
Returns when the context is canceled or a processing error occurs.
func FixPersistent ¶ added in v0.0.121
func FixPersistent(log logrus.FieldLogger, client queue.PersistClient, path gcs.Path, tick <-chan time.Time) Fixer
FixPersistent persists the updater queue using queue.FixPersistent.
type Metrics ¶ added in v0.0.72
Metrics holds metrics relevant to the Updater.
func CreateMetrics ¶ added in v0.0.111
CreateMetrics creates all the metrics that the Summarizer will use This should be called once
type UpdateOptions ¶ added in v0.0.156
type UpdateOptions struct { ConfigPath gcs.Path Concurrency int TabPathPrefix string SummaryPathPrefix string AllowedDashboards []string Confirm bool Features FeatureFlags Freq time.Duration }
UpdateOptions aggregates the Update function parameter into a single structure.