measurement

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package measurement export utility functions to manipulate/format performance profile sample values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonValueType

func CommonValueType(ts []*profile.ValueType) (*profile.ValueType, error)

CommonValueType returns the finest type from a set of compatible types.

func Label

func Label(value int64, unit string) string

Label returns the label used to describe a certain measurement.

func Percentage

func Percentage(value, total int64) string

Percentage computes the percentage of total of a value, and encodes it as a string. At least two digits of precision are printed.

func Scale

func Scale(value int64, fromUnit, toUnit string) (float64, string)

Scale a measurement from an unit to a different unit and returns the scaled value and the target unit. The returned target unit will be empty if uninteresting (could be skipped).

func ScaleProfiles

func ScaleProfiles(profiles []*profile.Profile) error

ScaleProfiles updates the units in a set of profiles to make them compatible. It scales the profiles to the smallest unit to preserve data.

func ScaledLabel

func ScaledLabel(value int64, fromUnit, toUnit string) string

ScaledLabel scales the passed-in measurement (if necessary) and returns the label used to describe a float measurement.

Types

This section is empty.

Jump to

Keyboard shortcuts

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