@@ -49,7 +49,7 @@ async def load_metric(metric: Metrics, timestamp, options: Options):
49
49
last_dot = element ["values" ][- 1 ]
50
50
51
51
# Convert counter value from str to int
52
- last_dot = last_dot [0 ], int (last_dot [1 ])
52
+ last_dot = last_dot [0 ], float (last_dot [1 ])
53
53
54
54
logger .debug (f"Found dot { last_dot } for { metric .output } { pretty_labels (labels )} " )
55
55
recatch_dots_by_key [key ] = last_dot
@@ -72,7 +72,7 @@ async def load_metric(metric: Metrics, timestamp, options: Options):
72
72
if key in recatch_dots_by_key :
73
73
74
74
# Store the last seen input counter
75
- metric .previous_values_by_key [key ] = int (values [- 1 ][1 ])
75
+ metric .previous_values_by_key [key ] = float (values [- 1 ][1 ])
76
76
77
77
# Remove the current metric from recatch_dots_by_key.
78
78
last_timestamp , counter_value = recatch_dots_by_key .pop (key )
@@ -84,7 +84,7 @@ async def load_metric(metric: Metrics, timestamp, options: Options):
84
84
for i in range (len (catchup_values ) - 1 ):
85
85
tn , vn = catchup_values [i ]
86
86
tnp , vnp = catchup_values [i + 1 ]
87
- vn , vnp , tn , tnp = int (vn ), int (vnp ), float (tn ), float (tnp )
87
+ vn , vnp , tn , tnp = float (vn ), float (vnp ), float (tn ), float (tnp )
88
88
increment = vnp - vn if vnp >= vn else vnp
89
89
input_counter_incr += increment
90
90
0 commit comments