util

package
v0.0.111 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package util has convenience functions for use throughout TestGrid.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Progress

func Progress(ctx context.Context, log logrus.FieldLogger, every time.Duration, total int, msg string) func(int)

Progress log every duration, including an ETA for completion. Returns a function for updating the current index

Types

type Queue added in v0.0.104

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

Queue can send names to receivers at a specific frequency.

Also contains the ability to modify the next time to send names. First call must be to Init(). Exported methods are safe to call concurrently.

func (*Queue) Fix added in v0.0.104

func (q *Queue) Fix(name string, when time.Time, later bool) error

Fix the next time to send the group to receivers.

If later is set then it will move out the next update time, otherwise it will only reduce it.

func (*Queue) FixAll added in v0.0.104

func (q *Queue) FixAll(whens map[string]time.Time, later bool) error

FixAll will fix multiple groups inside a single critical section.

If later is set then it will move out the next update time, otherwise it will only reduce it.

func (*Queue) Init added in v0.0.104

func (q *Queue) Init(log logrus.FieldLogger, names []string, when time.Time)

Init (or reinit) the queue with the specified groups, which should be updated at frequency.

func (*Queue) Send added in v0.0.104

func (q *Queue) Send(ctx context.Context, receivers chan<- string, frequency time.Duration) error

Send test groups to receivers until the context expires.

Pops items off the queue when frequency is zero. Otherwise reschedules the item after the specified frequency has elapsed.

func (*Queue) Status added in v0.0.104

func (q *Queue) Status() (int, *string, time.Time)

Status of the queue: depth, next item and when the next item is ready.

type Strings added in v0.0.110

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

Strings represents the value of a flag that accept multiple strings.

func (*Strings) Set added in v0.0.110

func (s *Strings) Set(value string) error

Set records the value passed

func (*Strings) String added in v0.0.110

func (s *Strings) String() string

String returns a concatenated string of all the values joined by commas.

func (*Strings) Strings added in v0.0.110

func (s *Strings) Strings() []string

Strings returns the slice of strings set for this value instance.

Directories

Path Synopsis
gcs
Package gcs provides utilities for interacting with GCS.
Package gcs provides utilities for interacting with GCS.
Package metrics provides metric reporting for TestGrid components.
Package metrics provides metric reporting for TestGrid components.

Jump to

Keyboard shortcuts

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