Documentation ¶
Index ¶
- type Metric
- type MetricOption
- func WithCurrentTime() MetricOption
- func WithDimensions(dims dimensions.NormalizedDimensionList) MetricOption
- func WithFloatCounterValueDelta(val float64) MetricOption
- func WithFloatGaugeValue(val float64) MetricOption
- func WithFloatSummaryValue(min, max, sum float64, count int64) MetricOption
- func WithIntCounterValueDelta(val int64) MetricOption
- func WithIntGaugeValue(val int64) MetricOption
- func WithIntSummaryValue(min, max, sum, count int64) MetricOption
- func WithPrefix(prefix string) MetricOption
- func WithTimestamp(t time.Time) MetricOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
Metric contains all information needed to create a string representation of the accumulated metric data.
type MetricOption ¶
MetricOption represents the function interface used to set options on the metric object.
func WithCurrentTime ¶
func WithCurrentTime() MetricOption
WithCurrentTime sets the current time as timestamp for the metric.
func WithDimensions ¶
func WithDimensions(dims dimensions.NormalizedDimensionList) MetricOption
WithDimensions sets the passed dimension list as the dimensions to export. Pass only dimension lists that have been de-duplicated (by dimensions.MergeLists)
func WithFloatCounterValueDelta ¶
func WithFloatCounterValueDelta(val float64) MetricOption
WithFloatCounterValueDelta sets a value on the metric that will be formatted as "count,delta=<value>" Returns an error if a value is already set, or if the value is NaN or Infinity.
func WithFloatGaugeValue ¶
func WithFloatGaugeValue(val float64) MetricOption
WithFloatGaugeValue sets a gauge value on the metric that will be formatted as "gauge,<value>" Retruns an error if the value is already set or if the value is NaN or Infinity.
func WithFloatSummaryValue ¶
func WithFloatSummaryValue(min, max, sum float64, count int64) MetricOption
WithFloatSummaryValue sets a summary statistic on the metric that will be formatted as
"gauge,min=<min>,max=<max>,sum=<sum>,count=<count>". Returns an error if the count is below 0, if min is greater than max, if a value is already set, or if any of min, max, or sum are NaN or infinite.
func WithIntCounterValueDelta ¶
func WithIntCounterValueDelta(val int64) MetricOption
WithIntCounterValueDelta sets a value on the metric that will be formatted as "count,delta=<value>" Returns an error if a value is already set.
func WithIntGaugeValue ¶
func WithIntGaugeValue(val int64) MetricOption
WithIntGaugeValue sets a gauge value on the metric that will be formatted as "gauge,<value>" Returns an error if a value is already set.
func WithIntSummaryValue ¶
func WithIntSummaryValue(min, max, sum, count int64) MetricOption
WithIntSummaryValue sets a summary statistic on the metric that will be formatted as "gauge,min=<min>,max=<max>,sum=<sum>,count=<count>". Returns an error if the count is below 0, if a value is already set, or if min is greater than max.
func WithPrefix ¶
func WithPrefix(prefix string) MetricOption
WithPrefix sets the prefix for Metric creation.
func WithTimestamp ¶
func WithTimestamp(t time.Time) MetricOption
WithTimestamp sets a specific timestamp for the metric. If the timestamp represents a time before 2000 or after 3000, no timestamp is set and the server timestamp will be used upon ingestion. This might be case if seconds or microseconds are set as milliseconds upon timestamp creation.