Documentation ¶
Overview ¶
Package measurement export utility functions to manipulate/format performance profile sample values.
Index ¶
- func CommonValueType(ts []*profile.ValueType) (*profile.ValueType, error)
- func Label(value int64, unit string) string
- func Percentage(value, total int64) string
- func Scale(value int64, fromUnit, toUnit string) (float64, string)
- func ScaleProfiles(profiles []*profile.Profile) error
- func ScaledLabel(value int64, fromUnit, toUnit string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommonValueType ¶
CommonValueType returns the finest type from a set of compatible types.
func Percentage ¶
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 ¶
Scale a measurement from a 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 ¶
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 ¶
ScaledLabel scales the passed-in measurement (if necessary) and returns the label used to describe a float measurement.
Types ¶
This section is empty.