Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions prometheus_client/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ def add_sample(self, name, labels, value):
self.samples.append((name, labels, value))

def __eq__(self, other):
return (isinstance(other, Metric)
and self.name == other.name
and self.documentation == other.documentation
and self.type == other.type
and self.samples == other.samples)
return (isinstance(other, Metric) and
self.name == other.name and
self.documentation == other.documentation and
self.type == other.type and
self.samples == other.samples)


class UntypedMetricFamily(Metric):
Expand Down Expand Up @@ -722,10 +722,11 @@ def f():
'''
_type = 'gauge'
_reserved_labelnames = []
_MULTIPROC_MODES = frozenset(('min', 'max', 'livesum', 'liveall', 'all'))

def __init__(self, name, labelnames, labelvalues, multiprocess_mode='all'):
if (_ValueClass._multiprocess
and multiprocess_mode not in ['min', 'max', 'livesum', 'liveall', 'all']):
if (_ValueClass._multiprocess and
multiprocess_mode not in self._MULTIPROC_MODES):
raise ValueError('Invalid multiprocess mode: ' + multiprocess_mode)
self._value = _ValueClass(
self._type, name, name, labelnames, labelvalues,
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,5 @@ ignore =
E741,
F841,
W293,
W503
import-order-style = google
application-import-names = prometheus_client