@@ -19,8 +19,9 @@ def _measure_networks(self, app_map, timestamp):
1919 stop = timestamp - (timestamp % 3600 )
2020 start = stop - 3600
2121 networks = []
22- for metric , (_ , value ) in async_to_sync (monitor .query_network_receive_flow (
23- app_map .keys (), start , stop )):
22+ for item in async_to_sync (monitor .query_network_receive_flow )(app_map .keys (), start , stop ): # noqa
23+ metric = item ["metric" ]
24+ _ , value = item ["value" ]
2425 networks .append ({
2526 "app_id" : str (app_map [metric ['namespace' ]].uuid ),
2627 "owner" : app_map [metric ['namespace' ]].owner_id ,
@@ -33,8 +34,9 @@ def _measure_networks(self, app_map, timestamp):
3334 },
3435 "timestamp" : start
3536 })
36- for metric , (_ , value ) in async_to_sync (monitor .query_network_transmit_flow (
37- app_map .keys (), start , stop )):
37+ for item in async_to_sync (monitor .query_network_transmit_flow )(app_map .keys (), start , stop ): # noqa
38+ metric = item ["metric" ]
39+ _ , value = item ["value" ]
3840 networks .append ({
3941 "app_id" : str (app_map [metric ['namespace' ]].uuid ),
4042 "owner" : app_map [metric ['namespace' ]].owner_id ,
0 commit comments