Documentation ¶
Overview ¶
Package metric provides base types for units, measurement and statistics.
Index ¶
- Constants
- Variables
- type Bitrate
- type Bytes
- func (b Bytes) Gibibytes() float64
- func (b Bytes) Gigabytes() float64
- func (b Bytes) Kibibytes() float64
- func (b Bytes) Kilobytes() float64
- func (b Bytes) Mebibytes() float64
- func (b Bytes) Megabytes() float64
- func (b Bytes) Pebibytes() float64
- func (b Bytes) Petabytes() float64
- func (b Bytes) String() string
- func (b Bytes) Tebibytes() float64
- func (b Bytes) Terabytes() float64
- type Duration
- type RelativeTime
Constants ¶
Variables ¶
View Source
var Tinit = time.Now()
Tinit is the base time used for RelativeTime values.
Functions ¶
This section is empty.
Types ¶
type Bitrate ¶
type Bitrate int64
Bitrate is a bitrate in bits per second.
func MaxBitrate ¶
func MinBitrate ¶
type Bytes ¶
type Bytes uint64
Bytes is a number of bytes.
type Duration ¶
Duration wraps a time.Duration and adds a TextUnmarshaler for conversion from a string, using time.ParseDuration.
func (*Duration) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type RelativeTime ¶
RelativeTime represents a time relative to a base time.
func Relative ¶
func Relative(t time.Time) RelativeTime
Relative returns the RelativeTime for t, with Tinit as a base.
func (RelativeTime) Duration ¶
func (r RelativeTime) Duration() time.Duration
Duration returns the RelativeTime as a time.Duration.
func (RelativeTime) String ¶
func (r RelativeTime) String() string
Click to show internal directories.
Click to hide internal directories.