Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
add optional params
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 committed Mar 28, 2019
1 parent d5ef933 commit 4af1cdb
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions metrics/Gauge.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ The value that is published for gauges is an instantaneous measurement of an `in
The following general operations MUST be provided by the API:
* Defining a `name`, `description`, `unit`, `labelKeys`, `resource` and `constantLabels` which are fixed labels that always apply to a gauge. This should give back the gauge object to get or create time series, remove time series and clear all time series.
* `name`: a string describing the name of the metric, e.g. "vm_cpu_cycles" or "queue_size". Names MUST be unique within the library. It is recommended to use names compatible with the intended end usage.
* `description`: a string describing the metric, e.g."Virtual cycles executed on VM".
* `unit`: a string describing the unit used for the metric (default set to "1"). Follows the format described by
[Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html).
* `labelKeys`: the list of the label keys to track different types of metric.
* `constantLabels`: the map of label keys and label values. The keys in `labelKeys` must not be present in this map.
* `resource`: the optional associated monitored resource information.
* `description`: an optional string describing the metric, e.g."Virtual cycles executed on VM". The default is set to "".
* `unit`: an optional string describing the unit used for the metric. Follows the format described by
[Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html). The default set to "1".
* `labelKeys`: an optional list of the label keys to track different types of metric. The default is set to empty list.
* `constantLabels`: an optional map of label keys and label values. The default is set to empty map.
* `resource`: an optional associated monitored resource information.
* Add a new time series with label values, which returns a `Point` (which is part of the `TimeSeries`). Each point represents an instantaneous measurement of a varying gauge value. Each Gauge Metric has one or more time series for a single metric.
* `labelValues`: the list of label values. The number of label values must be the same to that of the label keys.
* The `Point` class should provide functionalities to manually increment/decrement values. Example: `add(long amt)`, `set(long value)`.
Expand Down Expand Up @@ -48,7 +48,7 @@ void doSomeWork() {
point.set(15);
}
```
It is recommended to keep a reference of a point for manual operations instead of always calling `getOrCreateTimeSeries` method.
It is recommended to keep a reference of a point for manual operations instead of always calling `getOrCreateTimeSeries` method. The keys in `labelKeys` must not be present in `constantLabels` map. Also, `constantLabels` will be added to all the timeseries for the Metric.

## Derived Gauge API

Expand All @@ -57,12 +57,12 @@ The value that is published for gauges is an instantaneous measurement of an `in
The following general operations MUST be provided by the API:
* Defining a `name`, `description`, `unit`, `labelKeys`, `resource` and `constantLabels` which are fixed labels that always apply to a gauge. This should give back gauge object to add new time series, remove time series and clear all time series.
* `name`: a string describing the name of the metric, e.g. "vm_cpu_cycles". Names MUST be unique within the library. It is recommended to use names compatible with the intended end usage.
* `description`: a string describing the metric, e.g."Virtual cycles executed on VM".
* `unit`: a string describing the unit used for the metric (default set to "1"). Follows the format described by
[Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html).
* `labelKeys`: the list of the label keys to track different types of metric.
* `constantLabels`: the map of label keys and label values. The keys in `labelKeys` must not be present in this map.
* `resource`: the optional associated monitored resource information.
* `description`: an optional string describing the metric, e.g."Virtual cycles executed on VM". The default is set to "".
* `unit`: an optional string describing the unit used for the metric. Follows the format described by
[Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html). The default set to "1".
* `labelKeys`: an optional list of the label keys to track different types of metric. The default is set to empty list.
* `constantLabels`: an optional map of label keys and label values. The default is set to empty map.
* `resource`: an optional associated monitored resource information.
* Add a new time series with label values, an `object` and a `callback function`. The number of label values must be the same to that of the label keys.
* `labelValues`: the list of label values. The number of label values must be the same to that of the label keys.
* `object`: the state object from which the function derives a measurement.
Expand Down

0 comments on commit 4af1cdb

Please sign in to comment.