@@ -36,7 +36,7 @@ def __init__(self, name: str, documentation: str, typ: str, unit: str = ''):
36
36
self .type : str = typ
37
37
self .samples : List [Sample ] = []
38
38
39
- def add_sample (self , name : str , labels : Dict [str , str ], value : Union [ int , float ] , timestamp : Optional [Union [Timestamp , float ]] = None , exemplar : Optional [Exemplar ] = None ) -> None :
39
+ def add_sample (self , name : str , labels : Dict [str , str ], value : float , timestamp : Optional [Union [Timestamp , float ]] = None , exemplar : Optional [Exemplar ] = None ) -> None :
40
40
"""Add a sample to the metric.
41
41
42
42
Internal-only, do not use."""
@@ -77,7 +77,7 @@ class UnknownMetricFamily(Metric):
77
77
def __init__ (self ,
78
78
name : str ,
79
79
documentation : str ,
80
- value : Optional [Union [ int , float ] ] = None ,
80
+ value : Optional [float ] = None ,
81
81
labels : Optional [Sequence [str ]] = None ,
82
82
unit : str = '' ,
83
83
):
@@ -90,7 +90,7 @@ def __init__(self,
90
90
if value is not None :
91
91
self .add_metric ([], value )
92
92
93
- def add_metric (self , labels : Sequence [str ], value : Union [ int , float ] , timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
93
+ def add_metric (self , labels : Sequence [str ], value : float , timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
94
94
"""Add a metric to the metric family.
95
95
Args:
96
96
labels: A list of label values
@@ -112,7 +112,7 @@ class CounterMetricFamily(Metric):
112
112
def __init__ (self ,
113
113
name : str ,
114
114
documentation : str ,
115
- value : Optional [Union [ int , float ] ] = None ,
115
+ value : Optional [float ] = None ,
116
116
labels : Sequence [str ] = None ,
117
117
created : Optional [float ] = None ,
118
118
unit : str = '' ,
@@ -131,7 +131,7 @@ def __init__(self,
131
131
132
132
def add_metric (self ,
133
133
labels : Sequence [str ],
134
- value : Union [ int , float ] ,
134
+ value : float ,
135
135
created : Optional [float ] = None ,
136
136
timestamp : Optional [Union [Timestamp , float ]] = None ,
137
137
) -> None :
@@ -156,7 +156,7 @@ class GaugeMetricFamily(Metric):
156
156
def __init__ (self ,
157
157
name : str ,
158
158
documentation : str ,
159
- value : Optional [Union [ int , float ] ] = None ,
159
+ value : Optional [float ] = None ,
160
160
labels : Optional [Sequence [str ]] = None ,
161
161
unit : str = '' ,
162
162
):
@@ -169,7 +169,7 @@ def __init__(self,
169
169
if value is not None :
170
170
self .add_metric ([], value )
171
171
172
- def add_metric (self , labels : Sequence [str ], value : Union [ int , float ] , timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
172
+ def add_metric (self , labels : Sequence [str ], value : float , timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
173
173
"""Add a metric to the metric family.
174
174
175
175
Args:
@@ -189,7 +189,7 @@ def __init__(self,
189
189
name : str ,
190
190
documentation : str ,
191
191
count_value : Optional [int ] = None ,
192
- sum_value : Optional [Union [ int , float ] ] = None ,
192
+ sum_value : Optional [float ] = None ,
193
193
labels : Optional [Sequence [str ]] = None ,
194
194
unit : str = '' ,
195
195
):
@@ -208,7 +208,7 @@ def __init__(self,
208
208
def add_metric (self ,
209
209
labels : Sequence [str ],
210
210
count_value : int ,
211
- sum_value : Union [ int , float ] ,
211
+ sum_value : float ,
212
212
timestamp :
213
213
Optional [Union [float , Timestamp ]] = None
214
214
) -> None :
@@ -233,7 +233,7 @@ def __init__(self,
233
233
name : str ,
234
234
documentation : str ,
235
235
buckets : Optional [Sequence [Union [Tuple [str , float ], Tuple [str , float , Exemplar ]]]] = None ,
236
- sum_value : Optional [Union [ int , float ] ] = None ,
236
+ sum_value : Optional [float ] = None ,
237
237
labels : Optional [Sequence [str ]] = None ,
238
238
unit : str = '' ,
239
239
):
@@ -251,7 +251,7 @@ def __init__(self,
251
251
def add_metric (self ,
252
252
labels : Sequence [str ],
253
253
buckets : Sequence [Union [Tuple [str , float ], Tuple [str , float , Exemplar ]]],
254
- sum_value : Optional [Union [ int , float ] ],
254
+ sum_value : Optional [float ],
255
255
timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
256
256
"""Add a metric to the metric family.
257
257
@@ -295,7 +295,7 @@ def __init__(self,
295
295
name : str ,
296
296
documentation : str ,
297
297
buckets : Optional [Sequence [Tuple [str , float ]]] = None ,
298
- gsum_value : Optional [Union [ int , float ] ] = None ,
298
+ gsum_value : Optional [float ] = None ,
299
299
labels : Optional [Sequence [str ]] = None ,
300
300
unit : str = '' ,
301
301
):
@@ -311,7 +311,7 @@ def __init__(self,
311
311
def add_metric (self ,
312
312
labels : Sequence [str ],
313
313
buckets : Sequence [Tuple [str , float ]],
314
- gsum_value : Optional [Union [ int , float ] ],
314
+ gsum_value : Optional [float ],
315
315
timestamp : Optional [Union [float , Timestamp ]] = None ,
316
316
) -> None :
317
317
"""Add a metric to the metric family.
0 commit comments