Skip to content

Commit

Permalink
Fixed the recoverpoint consistency group WAN units when traffic is low
Browse files Browse the repository at this point in the history
  • Loading branch information
evanjfraser committed Mar 25, 2014
1 parent 30917fd commit fca0fb5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions recoverpoint/recoverpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,18 @@ def get_metrics(name):

#CG Lag and WAN stats are in the Link stats section
for repname in rawmetrics['Group'][group]['Link stats']:
#Get CG WAN metrics (remove 'Mbps' from end + convert to float and then bits)
metrics[group + '_WAN_Traffic'] = float(rawmetrics['Group'][group]['Link stats'][repname]['Replication']['WAN traffic'][:-4]) * 1024 * 1024

#Get CG WAN metrics (Work out the unit from end + convert to float and then bits)
##(remove 'Mbps' from end + convert to float and then bits)
#metrics[group + '_WAN_Traffic'] = float(rawmetrics['Group'][group]['Link stats'][repname]['Replication']['WAN traffic'][:-4]) * 1024 * 1024
cg_wan_str = rawmetrics['Group'][group]['Link stats'][repname]['Replication']['WAN traffic']
cg_wan_bw = float(cg_wan_str[:-4])
cg_wan_unit = cg_wan_str[-4:]
if 'Mbps' in cg_wan_unit:
cg_wan_bw = cg_wan_bw * 1024 * 1024
else:
cg_wan_bw = cg_wan_bw * 1024
metrics[group + '_WAN_Traffic'] = cg_wan_bw

#Get CG Lag metrics
for lagfields in rawmetrics['Group'][group]['Link stats'][repname]['Replication']['Lag']:
if 'Data' in lagfields:
Expand Down

0 comments on commit fca0fb5

Please sign in to comment.