telemetry

package
v0.0.0-...-b5d9cbe Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package telemetry is used to track test phase to provide telemetry metrics for the Tast tests.

Index

Constants

View Source
const (
	Test         string = "test"
	Framework    string = "framework"
	Fixture      string = "fixt"
	Precondition string = "pre"
)

entity types to mark phases

Variables

This section is empty.

Functions

func SetPhase

func SetPhase(ctx context.Context, phaseName, entityType, entityName string) context.Context

SetPhase starts a new Phase on the provided Context. If a Phase is currently set on the Context, then the current Phase will be ended before the new one is started. To use SetPhase to unset the current Phase, pass in "" for any of the string arguments.

phaseName: The name of the phase without entity information, e.g., "setup" for "tast setup" entityType: The type of entity being logged, e.g., telemetry.Framework for "tast setup" entityName: The name of the entity for this phase, e.g., "tast" for "tast setup"

Returns a new Context with the new Phase set.

Types

type PhaseInfo

type PhaseInfo struct {
	Name  string
	Start time.Time
}

PhaseInfo tracks metadata for the testing phase

func GetPhase

func GetPhase(ctx context.Context) (PhaseInfo, bool)

GetPhase pulls the Phase that is currently set on the Context.

Returns true for the second value if the PhaseInfo provided is the currently set Phase. Returns false for the second value if the Phase is not currently set on the provided Context.

Jump to

Keyboard shortcuts

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