Documentation
¶
Index ¶
- Constants
- func AddTestMetric(t *testing.T, tm *TestMetric)
- func AddTestMetrics(t *testing.T, testMetrics TestMetricsMap)
- func CleanupTestMetricsProducer(t *testing.T)
- func CollectMetrics(ctx context.Context, s *Schema, out chan<- Metric) error
- func Detach(ctx context.Context)
- func Fini()
- func GetAPIVersion() int
- func GetRank(ctx context.Context) (uint32, error)
- func HasBuckets(m Metric) bool
- func Init(parent context.Context, id uint32) (context.Context, error)
- func InitClientRoot(ctx context.Context) (context.Context, error)
- func InitTestMetricsProducer(t *testing.T, id int, size uint64)
- func NextTestID(base ...int) int
- func PruneUnusedSegments(ctx context.Context, maxSegAge time.Duration) error
- func RemoveTestMetrics(t *testing.T, testMetrics TestMetricsMap)
- func SetupClientRoot(ctx context.Context, jobid string, pid, shm_key int) error
- type Counter
- func (mb *Counter) Desc() string
- func (c *Counter) FloatValue() float64
- func (mb *Counter) FullPath() string
- func (mb *Counter) Name() string
- func (mb *Counter) Path() string
- func (mb *Counter) String() string
- func (c *Counter) Type() MetricType
- func (mb *Counter) Units() string
- func (c *Counter) Value() uint64
- type Duration
- func (d *Duration) FloatValue() float64
- func (sm *Duration) Max() uint64
- func (sm *Duration) Mean() float64
- func (sm *Duration) Min() uint64
- func (sm *Duration) SampleSize() uint64
- func (sm *Duration) StdDev() float64
- func (sm *Duration) Sum() uint64
- func (sm *Duration) SumSquares() float64
- func (d *Duration) Type() MetricType
- func (d *Duration) Value() time.Duration
- type Gauge
- type Histogram
- type HistogramBucket
- type HistogramSample
- type Metric
- type MetricType
- type Schema
- type Snapshot
- func (mb *Snapshot) Desc() string
- func (s *Snapshot) FloatValue() float64
- func (mb *Snapshot) FullPath() string
- func (mb *Snapshot) Name() string
- func (mb *Snapshot) Path() string
- func (mb *Snapshot) String() string
- func (s *Snapshot) Type() MetricType
- func (mb *Snapshot) Units() string
- func (s *Snapshot) Value() time.Time
- type StatsGauge
- func (g *StatsGauge) FloatValue() float64
- func (sm *StatsGauge) Max() uint64
- func (sm *StatsGauge) Mean() float64
- func (sm *StatsGauge) Min() uint64
- func (sm *StatsGauge) SampleSize() uint64
- func (sm *StatsGauge) StdDev() float64
- func (sm *StatsGauge) Sum() uint64
- func (sm *StatsGauge) SumSquares() float64
- func (g *StatsGauge) Type() MetricType
- func (g *StatsGauge) Value() uint64
- type StatsMetric
- type TestMetric
- type TestMetricsMap
- type Timestamp
- func (mb *Timestamp) Desc() string
- func (t *Timestamp) FloatValue() float64
- func (mb *Timestamp) FullPath() string
- func (mb *Timestamp) Name() string
- func (mb *Timestamp) Path() string
- func (mb *Timestamp) String() string
- func (t *Timestamp) Type() MetricType
- func (mb *Timestamp) Units() string
- func (t *Timestamp) Value() time.Time
Constants ¶
const ( MetricTypeUnknown MetricType = 0 MetricTypeCounter MetricType = C.D_TM_COUNTER MetricTypeDuration MetricType = C.D_TM_DURATION MetricTypeGauge MetricType = C.D_TM_GAUGE MetricTypeStatsGauge MetricType = C.D_TM_STATS_GAUGE MetricTypeSnapshot MetricType = C.D_TM_TIMER_SNAPSHOT MetricTypeTimestamp MetricType = C.D_TM_TIMESTAMP MetricTypeDirectory MetricType = C.D_TM_DIRECTORY MetricTypeLink MetricType = C.D_TM_LINK ClientJobRootID = C.DC_TM_JOB_ROOT_ID ClientJobMax = 1024 ClientMetricsEnabledEnv = C.DAOS_CLIENT_METRICS_ENABLE ClientMetricsRetainEnv = C.DAOS_CLIENT_METRICS_RETAIN BadUintVal = ^uint64(0) BadFloatVal = float64(BadUintVal) BadIntVal = int64(BadUintVal >> 1) BadDuration = time.Duration(BadIntVal) PathSep = filepath.Separator )
const ( PromexpIDBase = 200 AgentIDBase = 300 )
Variables ¶
This section is empty.
Functions ¶
func AddTestMetric ¶
func AddTestMetric(t *testing.T, tm *TestMetric)
func AddTestMetrics ¶
func AddTestMetrics(t *testing.T, testMetrics TestMetricsMap)
func GetAPIVersion ¶
func GetAPIVersion() int
func HasBuckets ¶
HasBuckets returns true if the metric has histogram data.
func NextTestID ¶
NextTestID gets the next available ID for a shmem segment. This helps avoid conflicts amongst tests running concurrently. Different packages should use different bases.
func PruneUnusedSegments ¶
PruneUnusedSegments removes shared memory segments associated with unused ephemeral subdirectories.
func RemoveTestMetrics ¶
func RemoveTestMetrics(t *testing.T, testMetrics TestMetricsMap)
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a counter metric.
func (*Counter) FloatValue ¶
func (*Counter) Type ¶
func (c *Counter) Type() MetricType
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
func (*Duration) FloatValue ¶
func (*Duration) SampleSize ¶
func (sm *Duration) SampleSize() uint64
func (*Duration) SumSquares ¶
func (sm *Duration) SumSquares() float64
func (*Duration) Type ¶
func (d *Duration) Type() MetricType
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge is a metric that consists of a single value that may increase or decrease.
func (*Gauge) FloatValue ¶
FloatValue returns the value as a float.
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram provides access to histogram data associated with a parent metric.
func (*Histogram) Buckets ¶
func (h *Histogram) Buckets() []HistogramBucket
Buckets returns the histogram buckets.
func (*Histogram) NumBuckets ¶
NumBuckets returns a count of buckets in the histogram.
func (*Histogram) Sample ¶
func (h *Histogram) Sample(cur float64) *HistogramSample
Sample returns a point-in-time sample of the histogram.
type HistogramBucket ¶
HistogramBucket contains the min/max values and count for a single bucket.
func GetBuckets ¶
func GetBuckets(m Metric) ([]HistogramBucket, error)
GetBuckets returns the histogram buckets for the metric, if available.
type HistogramSample ¶
type HistogramSample struct { Count uint64 Sum uint64 Buckets []HistogramBucket Values []uint64 }
HistogramSample contains the results of a histogram sample.
func SampleHistogram ¶
func SampleHistogram(m Metric) (*HistogramSample, error)
SampleHistogram returns a point-in-time sample of the histogram for the metric, if available.
type MetricType ¶
type MetricType int
func (MetricType) String ¶
func (mt MetricType) String() string
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func (*Snapshot) FloatValue ¶
func (*Snapshot) Type ¶
func (s *Snapshot) Type() MetricType
type StatsGauge ¶
type StatsGauge struct {
// contains filtered or unexported fields
}
StatsGauge is a gauge with statistics gathered.
func GetStatsGauge ¶
func GetStatsGauge(ctx context.Context, name string) (*StatsGauge, error)
GetStatsGauge finds the gauge with statistics with the given name in the telemetry tree.
func (*StatsGauge) FloatValue ¶
func (g *StatsGauge) FloatValue() float64
FloatValue returns the gauge value as a float.
func (*StatsGauge) SampleSize ¶
func (sm *StatsGauge) SampleSize() uint64
func (*StatsGauge) SumSquares ¶
func (sm *StatsGauge) SumSquares() float64
func (*StatsGauge) Type ¶
func (g *StatsGauge) Type() MetricType
Type returns the type of the gauge with stats.
func (*StatsGauge) Value ¶
func (g *StatsGauge) Value() uint64
Value returns the gauge value as an unsigned integer.
type StatsMetric ¶
type TestMetric ¶
type TestMetric struct { Type MetricType Name string Cur float64 // value - may be exact or approximate Values []uint64 // contains filtered or unexported fields }
func (*TestMetric) FullPath ¶
func (tm *TestMetric) FullPath() string
type TestMetricsMap ¶
type TestMetricsMap map[MetricType]*TestMetric
type Timestamp ¶
type Timestamp struct {
// contains filtered or unexported fields
}
func (*Timestamp) FloatValue ¶
FloatValue converts the timestamp to time in seconds since the UNIX epoch.
func (*Timestamp) Type ¶
func (t *Timestamp) Type() MetricType