Emmanuel BENOîT
78af496fe9
This PR refactors most of the internals to make them easier to test (and also because the names didn't make sense). It adds unit tests for all internal components. Reviewed-on: #2 Co-authored-by: Emmanuel BENOÎT <tseeker@nocternity.net> Co-committed-by: Emmanuel BENOÎT <tseeker@nocternity.net>
20 lines
433 B
Go
20 lines
433 B
Go
package perfdata // import nocternity.net/gomonop/pkg/perfdata
|
|
|
|
// Units of measurement, which may be used to qualify the performance data.
|
|
type UnitOfMeasurement int
|
|
|
|
const (
|
|
UomNone UnitOfMeasurement = iota
|
|
UomSeconds
|
|
UomPercent
|
|
UomBytes
|
|
UomKilobytes
|
|
UomMegabytes
|
|
UomGigabytes
|
|
UomTerabytes
|
|
UomCounter
|
|
)
|
|
|
|
func (u UnitOfMeasurement) String() string {
|
|
return [...]string{"", "s", "%", "B", "KB", "MB", "GB", "TB", "c"}[u]
|
|
}
|