Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

vmnetwork scf change:ip--->total

  • Loading branch information...
commit 385c1bae974b2545d16e0b46da25564e040cb879 1 parent ccc3d78
@hokerffb hokerffb authored
Showing with 5 additions and 2 deletions.
  1. +4 −1 kanyun/server/api_server.py
  2. +1 −1  kanyun/server/data_server.py
View
5 kanyun/server/api_server.py
@@ -278,7 +278,10 @@ def query_usage_report(self, args, **kwargs):
row_id = args['id']
cf_str = args['metric']
- scf_str = args['metric_param']
+ if args.has_key("metric_param"):
+ scf_str = args['metric_param']
+ else:
+ scf_str = "total"
statistic = args['statistic']
period = int(args['period'])
timestamp_from = args['timestamp_from']
View
2  kanyun/server/data_server.py
@@ -200,7 +200,7 @@ def plugin_decoder_traffic_accounting(app, db, data):
if len(i) > 2:
traffic = i[2]
print data_id, "-->", instance_uuid, "\033[1;32m", traffic, "\033[0m"
- db.insert('vmnetwork', instance_uuid, {i[0]: {i[1]: traffic}})
+ db.insert('vmnetwork', instance_uuid, {"total": {i[1]: traffic}})
print 'spend \033[1;33m%f\033[0m seconds' % (time.time() - pass_time)
def SignalHandler(sig, id):
Please sign in to comment.
Something went wrong with that request. Please try again.