@@ -274,26 +274,26 @@ def describe(self):
274
274
"AlgorithmSpecification" : {
275
275
"ContainerEntrypoint" : self .container .container_entrypoint ,
276
276
},
277
- "FinalMetricDataList" : self ._extract_final_metrics ()
277
+ "FinalMetricDataList" : self ._extract_final_metrics (),
278
278
}
279
279
return response
280
280
281
281
def _extract_final_metrics (self ):
282
282
"""Extract metrics from container logs using metric definitions."""
283
- if not hasattr (self .container , ' logs' ) or not self .container .logs :
283
+ if not hasattr (self .container , " logs" ) or not self .container .logs :
284
284
return []
285
285
286
286
# Get metric definitions from container
287
- metric_definitions = getattr (self .container , ' metric_definitions' , [])
287
+ metric_definitions = getattr (self .container , " metric_definitions" , [])
288
288
if not metric_definitions :
289
289
return []
290
290
291
291
final_metrics = []
292
292
logs = self .container .logs
293
293
294
294
for metric_def in metric_definitions :
295
- metric_name = metric_def .get (' Name' )
296
- regex_pattern = metric_def .get (' Regex' )
295
+ metric_name = metric_def .get (" Name" )
296
+ regex_pattern = metric_def .get (" Regex" )
297
297
298
298
if not metric_name or not regex_pattern :
299
299
continue
@@ -303,14 +303,17 @@ def _extract_final_metrics(self):
303
303
if matches :
304
304
# Use the last match as final metric
305
305
final_value = float (matches [- 1 ])
306
- final_metrics .append ({
307
- 'MetricName' : metric_name ,
308
- 'Value' : final_value ,
309
- 'Timestamp' : self .end_time or datetime .now ()
310
- })
306
+ final_metrics .append (
307
+ {
308
+ "MetricName" : metric_name ,
309
+ "Value" : final_value ,
310
+ "Timestamp" : self .end_time or datetime .now (),
311
+ }
312
+ )
311
313
312
314
return final_metrics
313
315
316
+
314
317
class _LocalTransformJob (object ):
315
318
"""Placeholder docstring"""
316
319
0 commit comments