Skip to content

Commit 58f390a

Browse files
authored
Tell the truth about the supported metric types (#161)
Our README claims we support 4 metric types, and then lists five. But it fails to list FloatingPointCounter, which we also support, so the real number is six. While I was here I also fixed the DocC topic, which omitted FloatingPointCounter from the list of metrics but _also_ omitted Gauge for some weird reason.
1 parent 53de3bf commit 58f390a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,18 @@ This API was designed with the contributors to the Swift on Server community and
9090

9191
### Metric types
9292

93-
The API supports four metric types:
93+
The API supports six metric types:
9494

9595
`Counter`: A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero on restart. For example, you can use a counter to represent the number of requests served, tasks completed, or errors.
9696

9797
```swift
9898
counter.increment(by: 100)
99+
```
100+
101+
- `FloatingPointCounter`: A variation of a `Counter` that records a floating point value, instead of an integer.
102+
103+
```swift
104+
floatingPointCounter.increment(by: 10.5)
99105
```
100106

101107
`Gauge`: A Gauge is a metric that represents a single numerical value that can arbitrarily go up and down. Gauges are typically used for measured values like temperatures or current memory usage, but also "counts" that can go up and down, like the number of active threads. Gauges are modeled as a `Recorder` with a sample size of 1 that does not perform any aggregation.

Diff for: Sources/CoreMetrics/Docs.docc/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ This API was designed with the contributors to the Swift on Server community and
9191
### Metric types
9292

9393
- ``Counter``
94+
- ``FloatingPointCounter``
9495
- ``Meter``
9596
- ``Recorder``
97+
- ``Gauge``
9698
- ``Timer``
9799

0 commit comments

Comments
 (0)