@@ -356,13 +356,13 @@ def system(request):
356
356
)
357
357
358
358
api_stats = [['Endpoint' , 'Total' ]]
359
- api_user_stats = [['User' , 'Total' ]]
359
+ api_space_stats = [['User' , 'Total' ]]
360
360
total_stats = ['All' , int (r .get ('api:request-count' ))]
361
361
362
362
for i in range (0 , 6 ):
363
363
d = (date .today () - timedelta (days = i )).isoformat ()
364
364
api_stats [0 ].append (d )
365
- api_user_stats [0 ].append (d )
365
+ api_space_stats [0 ].append (d )
366
366
total_stats .append (int (r .get (f'api:request-count:{ d } ' )) if r .get (f'api:request-count:{ d } ' ) else 0 )
367
367
368
368
api_stats .append (total_stats )
@@ -375,19 +375,19 @@ def system(request):
375
375
endpoint_stats .append (r .zscore (f'api:endpoint-request-count:{ d } ' , endpoint ))
376
376
api_stats .append (endpoint_stats )
377
377
378
- for x in r .zrange ('api:user -request-count' , 0 , 20 , withscores = True , desc = True ):
379
- u = x [0 ].decode ('utf-8' )
380
- user_stats = [User .objects .get (pk = u ). username , x [1 ]]
378
+ for x in r .zrange ('api:space -request-count' , 0 , 20 , withscores = True , desc = True ):
379
+ s = x [0 ].decode ('utf-8' )
380
+ space_stats = [Space .objects .get (pk = s ). name , x [1 ]]
381
381
for i in range (0 , 6 ):
382
382
d = (date .today () - timedelta (days = i )).isoformat ()
383
- user_stats .append (r .zscore (f'api:user -request-count:{ d } ' , u ))
384
- api_user_stats .append (user_stats )
383
+ space_stats .append (r .zscore (f'api:space -request-count:{ d } ' , s ))
384
+ api_space_stats .append (space_stats )
385
385
386
386
return render (
387
387
request , 'system.html' , {
388
388
'gunicorn_media' : settings .GUNICORN_MEDIA , 'debug' : settings .DEBUG , 'postgres' : postgres , 'postgres_version' : postgres_ver , 'postgres_status' : database_status ,
389
389
'postgres_message' : database_message , 'version_info' : VERSION_INFO , 'plugins' : PLUGINS , 'secret_key' : secret_key , 'orphans' : orphans , 'migration_info' : migration_info ,
390
- 'missing_migration' : missing_migration , 'allowed_hosts' : settings .ALLOWED_HOSTS , 'api_stats' : api_stats , 'api_user_stats ' : api_user_stats
390
+ 'missing_migration' : missing_migration , 'allowed_hosts' : settings .ALLOWED_HOSTS , 'api_stats' : api_stats , 'api_space_stats ' : api_space_stats
391
391
})
392
392
393
393
0 commit comments