Commit 0c4c677
Om Pathak
Make clear() a no-op for label-less metrics instead of raising AttributeError
Fixes #707. clear() unconditionally acquired self._lock, which is
never created for metrics with no labelnames, causing an
AttributeError. Per discussion in the issue (csmarchbanks,
roidelapluie, sdfordham, tomprince), a label-less metric has no
labelsets to clear, so clear() now treats this as a no-op rather
than raising.
Signed-off-by: Om Pathak <ompathak@gmail.com>1 parent c0e416d commit 0c4c677
2 files changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
257 | 259 | | |
258 | 260 | | |
259 | 261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
0 commit comments