digest_counter

package
v0.0.0-...-33de393 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

digest_counter returns counts of digests for various views on a Tile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

Counter implements DigestCounter

func New

func New(tile *tiling.Tile) *Counter

New creates a new Counter object.

func (*Counter) ByQuery

func (t *Counter) ByQuery(tile *tiling.Tile, query paramtools.ParamSet) DigestCount

ByQuery returns a DigestCount of all the digests that match the given query in the provided tile.

func (*Counter) ByTest

func (t *Counter) ByTest() map[types.TestName]DigestCount

ByTest implements the DigestCounter interface.

func (*Counter) ByTrace

func (t *Counter) ByTrace() map[tiling.TraceID]DigestCount

ByTrace implements the DigestCounter interface.

func (*Counter) MaxDigestsByTest

func (t *Counter) MaxDigestsByTest() map[types.TestName]types.DigestSet

MaxDigestsByTest implements the DigestCounter interface.

type DigestCount

type DigestCount map[types.Digest]int

DigestCount maps a digest to a count. These counts are the number of times a digest was seen in a given scenario.

type DigestCounter

type DigestCounter interface {
	// ByTest returns a map of test_name -> DigestCount
	ByTest() map[types.TestName]DigestCount

	// ByTrace returns a map of trace_id -> DigestCount
	ByTrace() map[tiling.TraceID]DigestCount

	// MaxDigestsByTest returns a map of all tests seen
	// in the tile mapped to the digest that showed up
	// the most in that test.
	MaxDigestsByTest() map[types.TestName]types.DigestSet

	// ByQuery returns a DigestCount of all the digests that match the given query in
	// the provided tile. Note that this will recompute the digests across the entire tile.
	ByQuery(tile *tiling.Tile, query paramtools.ParamSet) DigestCount
}

DigestCounter allows querying for digest counts for a digest in different ways. For example, how many times did this tile see a given digest in a given test or a given trace? The results can be further filtered using ByQuery. It should be immutable once created and therefore thread-safe.

Jump to

Keyboard shortcuts

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