luci: go.chromium.org/luci/common/tsmon/types Index | Files

package types

import "go.chromium.org/luci/common/tsmon/types"

Package types contains miscellaneous structs and interfaces used throughout tsmon. They live here to avoid circular dependencies between other packages.

Index

Package Files

cell.go doc.go metric.go metric_data_units.go target.go value_type.go

Constants

const (
    Unknown      = ""
    Seconds      = "s"
    Milliseconds = "ms"
    Microseconds = "us"
    Nanoseconds  = "ns"
    Bits         = "B"
    Bytes        = "By"

    Kilobytes = "kBy"  // 1000 bytes (not 1024).
    Megabytes = "MBy"  // 1e6 (1,000,000) bytes.
    Gigabytes = "GBy"  // 1e9 (1,000,000,000) bytes.
    Kibibytes = "kiBy" // 1024 bytes.
    Mebibytes = "MiBy" // 1024^2 (1,048,576) bytes.
    Gibibytes = "GiBy" // 1024^3 (1,073,741,824) bytes.

    // * Extended Units
    AmpUnit           = "A"
    MilliampUnit      = "mA"
    DegreeCelsiusUnit = "Cel"
)

Units of metrics data.

type Cell Uses

type Cell struct {
    MetricInfo
    MetricMetadata
    CellData
}

Cell is the smallest unit of data recorded by tsmon. Metrics can be thought of as multi-dimensional maps (with fields defining the dimensions) - a Cell is one value in that map, with information about its fields and its type.

type CellData Uses

type CellData struct {
    FieldVals []interface{}
    Target    Target
    ResetTime time.Time
    Value     interface{}
}

CellData contains the value of a single cell.

type DistributionMetric Uses

type DistributionMetric interface {
    Metric

    Bucketer() *distribution.Bucketer
}

DistributionMetric is the low-level interface provided by all distribution metrics. It has a Bucketer which is responsible for assigning buckets to samples. Concrete types are defined in the "metrics" package.

type Metric Uses

type Metric interface {
    Info() MetricInfo
    Metadata() MetricMetadata

    // SetFixedResetTime overrides the reset time for this metric.  Usually cells
    // take the current time when they're first assigned a value, but it can be
    // useful to override the reset time when tracking an external counter.
    SetFixedResetTime(t time.Time)
}

Metric is the low-level interface provided by all metrics. Concrete types are defined in the "metrics" package.

type MetricDataUnits Uses

type MetricDataUnits string

MetricDataUnits are enums for the units of metrics data.

func (MetricDataUnits) IsSpecified Uses

func (units MetricDataUnits) IsSpecified() bool

IsSpecified returns true if a unit annotation has been specified for a given metric.

type MetricInfo Uses

type MetricInfo struct {
    Name        string
    Description string
    Fields      []field.Field
    ValueType   ValueType
}

MetricInfo contains the definition of a metric.

type MetricMetadata Uses

type MetricMetadata struct {
    Units MetricDataUnits // the unit of recorded data for a given metric.
}

MetricMetadata contains user-provided metadata for a metric.

type Target Uses

type Target interface {
    PopulateProto(d *pb.MetricsCollection)
    Hash() uint64
    Clone() Target
}

A Target knows how to put information about itself in a MetricsData message.

type ValueType Uses

type ValueType int

ValueType is an enum for the type of a metric.

const (
    NonCumulativeIntType ValueType = iota
    CumulativeIntType
    NonCumulativeFloatType
    CumulativeFloatType
    StringType
    BoolType
    NonCumulativeDistributionType
    CumulativeDistributionType
)

Types of metric values.

func (ValueType) IsCumulative Uses

func (v ValueType) IsCumulative() bool

IsCumulative returns true if this is a cumulative metric value type.

func (ValueType) String Uses

func (v ValueType) String() string

Package types imports 5 packages (graph) and is imported by 34 packages. Updated 2018-12-17. Refresh now. Tools for package owners.