Skip to content

Commit

Permalink
Changed metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
JosepSampe committed Oct 4, 2017
1 parent 0f07f64 commit e19b29b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion api/filters/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import os

from api.common import rsync_dir_with_nodes, JSONResponse, \
get_redis_connection, get_token_connection, make_sure_path_exists, save_file, md5
get_redis_connection, get_token_connection, make_sure_path_exists, save_file, md5,\
to_json_bools
from api.exceptions import SwiftClientError, StorletNotFoundException, FileSynchronizationException

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -85,6 +86,7 @@ def filter_detail(request, filter_id):

if request.method == 'GET':
my_filter = r.hgetall("filter:" + str(filter_id))
to_json_bools(my_filter, 'put', 'get')
return JSONResponse(my_filter, status=status.HTTP_200_OK)

elif request.method == 'PUT':
Expand Down
5 changes: 4 additions & 1 deletion api/metrics/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ def metric_module_detail(request, metric_module_id):
redis_data.update(data)
data = redis_data

metric_name = data['metric_name'].split('.')[0]
if 'metric_name' not in data:
metric_name = r.hget('workload_metric:' + str(metric_id), 'metric_name').split('.')[0]
else:
metric_name = data['metric_name'].split('.')[0]

if data['enabled']:
try:
Expand Down

0 comments on commit e19b29b

Please sign in to comment.