Skip to content

Commit a4a1793

Browse files
committed
Tweak docs
1 parent d0662bd commit a4a1793

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Counters go up, and reset when the process restarts.
2525
```python
2626
from prometheus_client import Counter
2727
c = Counter('my_failures_total', 'Description of counter')
28-
c.inc() # Increment by 1
29-
c.inc(10) # Increment by given value
28+
c.inc() # Increment by 1
29+
c.inc(1.6) # Increment by given value
3030
```
3131

3232
There are utilities to count exceptions raised:
@@ -39,6 +39,7 @@ def f():
3939
with c.countExceptions():
4040
pass
4141

42+
# Count only one type of exception
4243
with c.countExceptions(ValueError):
4344
pass
4445
```
@@ -51,9 +52,9 @@ Gauges can go up and down.
5152
```python
5253
from prometheus_client import Gauge
5354
g = Gauge('my_inprogress_requests', 'Description of gauge')
54-
g.inc() # Increment by 1
55-
g.dev(10) # Decrement by given value
56-
g.set(7) # Set to a given value
55+
g.inc() # Increment by 1
56+
g.dev(10) # Decrement by given value
57+
g.set(4.2) # Set to a given value
5758
```
5859

5960
There are utilities for common use cases:
@@ -77,18 +78,17 @@ Summaries track the size and number of events.
7778
```python
7879
from prometheus_client import Summary
7980
s = Summary('request_latency_seconds', 'Description of summary')
80-
s.observe(5) # Observe 5 (seconds)
81+
s.observe(4.7) # Observe 4.7 (seconds in this case)
8182
```
8283

83-
There are utilities for common use cases:
84+
There are utilities for timing code:
8485

8586
```python
86-
# Increment when entered, decrement when exited.
87-
@g.time()
87+
@s.time()
8888
def f():
8989
pass
9090

91-
with g.time():
91+
with s.time():
9292
pass
9393
```
9494

0 commit comments

Comments
 (0)