@@ -80,7 +80,7 @@ class MetricManager:
80
80
81
81
def __init__ (
82
82
self ,
83
- metric_set : Dict [str , str ] = None ,
83
+ metric_set : Dict [str , Any ] = None ,
84
84
dimension_set : Dict = None ,
85
85
namespace : str = None ,
86
86
metadata_set : Dict [str , Any ] = None ,
@@ -125,7 +125,7 @@ def add_metric(self, name: str, unit: Union[MetricUnit, str], value: float):
125
125
raise MetricValueError (f"{ value } is not a valid number" )
126
126
127
127
unit = self .__extract_metric_unit_value (unit = unit )
128
- metric = self .metric_set .get (name , defaultdict (list ))
128
+ metric : dict = self .metric_set .get (name , defaultdict (list ))
129
129
metric ["Unit" ] = unit
130
130
metric ["Value" ].append (float (value ))
131
131
logger .debug (f"Adding metric: { name } with { metric } " )
@@ -185,7 +185,7 @@ def serialize_metric_set(self, metrics: Dict = None, dimensions: Dict = None, me
185
185
logger .debug ({"details" : "Serializing metrics" , "metrics" : metrics , "dimensions" : dimensions })
186
186
187
187
metric_names_and_units : List [Dict [str , str ]] = [] # [ { "Name": "metric_name", "Unit": "Count" } ]
188
- metric_names_and_values : Dict [str , str ] = {} # { "metric_name": 1.0 }
188
+ metric_names_and_values : Dict [str , int ] = {} # { "metric_name": 1.0 }
189
189
190
190
for metric_name in metrics :
191
191
metric : dict = metrics [metric_name ]
0 commit comments