77from django .conf import settings
88from api import monitor
99from api .models .app import App
10- from api .tasks import send_measurements
10+ from api .tasks import send_usage
1111
1212logger = logging .getLogger (__name__ )
1313
1414
1515class Command (BaseCommand ):
1616 """Management command for push data to manager"""
1717
18- def _measure_networks (self , app_map , timestamp ):
18+ def _upload_network_usage (self , app_map , timestamp ):
1919 stop = timestamp - (timestamp % 3600 )
2020 start = stop - 3600
2121 networks = []
@@ -49,7 +49,7 @@ def _measure_networks(self, app_map, timestamp):
4949 },
5050 "timestamp" : start
5151 })
52- send_measurements .delay (networks )
52+ send_usage .delay (networks )
5353
5454 def handle (self , * args , ** options ):
5555 if settings .WORKFLOW_MANAGER_URL :
@@ -60,9 +60,9 @@ def handle(self, *args, **options):
6060 for app in App .objects .all ():
6161 app_map [app .id ] = app
6262 if len (app_map ) % 1000 == 0 :
63- self ._measure_networks (app_map , timestamp )
63+ self ._upload_network_usage (app_map , timestamp )
6464 app_map = {}
6565 if len (app_map ) > 0 :
66- self ._measure_networks (app_map , timestamp )
66+ self ._upload_network_usage (app_map , timestamp )
6767 logger .info (f"pushed { task_id } limits to workflow_manager when { timezone .now ()} " )
6868 self .stdout .write ("done" )
0 commit comments