validate

package
v3.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTrackIDs

func GetTrackIDs(ctx context.Context, s Scope, processor *perfetto.Processor) ([]int64, error)

GetTrackIDs returns all track ids from gpu_track with the given scope.

func IsNumber

IsNumber is a checker that checks that the column is a number type.

func ValidateGpuCounters

func ValidateGpuCounters(ctx context.Context, processor *perfetto.Processor, counters []GpuCounter, passThreshold int) error

ValidateGpuCounters queries for the GPU counter from the trace and validates the value based on the associated check, up to the amount specified in passThreshold.

func ValidateGpuSlices

func ValidateGpuSlices(ctx context.Context, processor *perfetto.Processor) error

ValidateGpuSlices validates gpu slices, returns nil if all validation passes.

func ValidateVulkanEvents

func ValidateVulkanEvents(ctx context.Context, processor *perfetto.Processor) error

ValidateVulkanEvents validates vulkan events slices, returns nil if all validation passes.

Types

type Checker

Checker is a function that checks the validity of the values of the given result set column.

func And

func And(cs ...Checker) Checker

And returns a checker that is only valid if all of its arguments are.

func Average

func Average(check func(float64) bool) Checker

Average returns a checker that checks whether the average values meets the condition

func CheckAllEqualTo

func CheckAllEqualTo(num float64) Checker

CheckAllEqualTo returns a checker that checks that all returned value equal the given value.

func CheckAverageApproximateTo

func CheckAverageApproximateTo(num, margin float64) Checker

CheckAverageApproximateTo checks whether the average of the values is within a margin of the given value.

func CheckLargerThanZero

func CheckLargerThanZero() Checker

CheckLargerThanZero is a checker that checks that the values are all greater than zero.

func CheckNonNegative

func CheckNonNegative() Checker

CheckNonNegative is a checker that checks that no value is less than zero.

func ForeachValue

func ForeachValue(check func(float64) bool) Checker

func Not

func Not(c Checker) Checker

Not returns a checker that returns the inverse of the given checker.

type GpuCounter

type GpuCounter struct {
	Id    uint32
	Name  string
	Check Checker
}

GpuCounter represents a GPU counter for which the profiling data is validated.

type Scope

type Scope string

type Validator

type Validator interface {
	Validate(ctx context.Context, processor *perfetto.Processor) error
	GetCounters() []GpuCounter
	GetType() service.DeviceValidationResult_ValidatorType
}

Validator is an interface implemented by the various hardware specific validators.

Jump to

Keyboard shortcuts

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