@@ -175,11 +175,11 @@ def add_sample(self, name, labels, value):
175
175
self .samples .append ((name , labels , value ))
176
176
177
177
def __eq__ (self , other ):
178
- return (isinstance (other , Metric )
179
- and self .name == other .name
180
- and self .documentation == other .documentation
181
- and self .type == other .type
182
- and self .samples == other .samples )
178
+ return (isinstance (other , Metric ) and
179
+ self .name == other .name and
180
+ self .documentation == other .documentation and
181
+ self .type == other .type and
182
+ self .samples == other .samples )
183
183
184
184
185
185
class UntypedMetricFamily (Metric ):
@@ -722,10 +722,11 @@ def f():
722
722
'''
723
723
_type = 'gauge'
724
724
_reserved_labelnames = []
725
+ _MULTIPROC_MODES = frozenset (('min' , 'max' , 'livesum' , 'liveall' , 'all' ))
725
726
726
727
def __init__ (self , name , labelnames , labelvalues , multiprocess_mode = 'all' ):
727
- if (_ValueClass ._multiprocess
728
- and multiprocess_mode not in [ 'min' , 'max' , 'livesum' , 'liveall' , 'all' ] ):
728
+ if (_ValueClass ._multiprocess and
729
+ multiprocess_mode not in self . _MULTIPROC_MODES ):
729
730
raise ValueError ('Invalid multiprocess mode: ' + multiprocess_mode )
730
731
self ._value = _ValueClass (
731
732
self ._type , name , name , labelnames , labelvalues ,
0 commit comments