Skip to content

Commit

Permalink
Fix issue with retrieving the db usage info in analytics-api
Browse files Browse the repository at this point in the history
Change-Id: I21fbac8eb8d5659476b4235cfdfcfec27feb6e90
Closes-Bug: #1614285
  • Loading branch information
Sundaresan Rajangam committed Aug 18, 2016
1 parent 7181bf7 commit 0ec8bf7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/opserver/analytics_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,14 @@ def get_dbusage_info(self, ip, port, user, password):
uve_url = "http://" + ip + ":" + str(port) + \
"/analytics/uves/database-nodes?cfilt=DatabaseUsageInfo"
data = OpServerUtils.get_url_http(uve_url, user, password)
node_dburls = json.loads(data)
node_dburls = json.loads(data.text)

for node_dburl in node_dburls:
# calculate disk usage percentage for analytics in each
# cassandra node
db_uve_data = OpServerUtils.get_url_http(node_dburl['href'],
user, password)
db_uve_state = json.loads(db_uve_data)
db_uve_state = json.loads(db_uve_data.text)
db_usage_in_perc = (100*
float(db_uve_state['DatabaseUsageInfo']['database_usage'][0]['analytics_db_size_1k'])/
float(db_uve_state['DatabaseUsageInfo']['database_usage'][0]['disk_space_available_1k'] +
Expand Down

0 comments on commit 0ec8bf7

Please sign in to comment.