Documentation
¶
Overview ¶
Package units provides a set of predefined units that can be used in the custom metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Unit ¶
type Unit string
The unit should be defined using the appropriate [UCUM](https://ucum.org) case-sensitive code.
const ( // Time Days Unit = "d" Hours Unit = "h" Minutes Unit = "min" Seconds Unit = "s" Milliseconds Unit = "ms" Microseconds Unit = "us" Nanoseconds Unit = "ns" // Bytes Bytes Unit = "By" Kibibytes Unit = "KiBy" Mebibytes Unit = "MiBy" Gibibytes Unit = "GiBy" Tebibytes Unit = "TiBy" Kilobytes Unit = "KBy" Megabytes Unit = "MBy" Gigabytes Unit = "GBy" Terabytes Unit = "TBy" // SI Units Meters Unit = "m" Volts Unit = "V" Amperes Unit = "A" Joules Unit = "J" Watts Unit = "W" Grams Unit = "g" // Misc Celsius Unit = "Cel" Hertz Unit = "Hz" Ratio Unit = "1" Percent Unit = "%" )
func GenerateUnit ¶
GenerateUnit creates a new unit with the given quantity, wrapped in curly braces.
All non-units that use curly braces to annotate a quantity need to match the grammatical number of the quantity it represent. For example if measuring the number of individual requests to a process the unit would be {request}, not {requests}.
Click to show internal directories.
Click to hide internal directories.