Skip to content
Browse files

We need out segments for tcp attemptfails :-(

  • Loading branch information...
1 parent a37c665 commit dcd01ec33cec1bd3823a51558503064e813aae8b @vvuksan vvuksan committed Jan 3, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 network/netstats/python_modules/netstats.py
View
4 network/netstats/python_modules/netstats.py
@@ -118,7 +118,7 @@ def get_tcpattemptfail_percentage(name):
[curr_metrics, last_metrics] = get_metrics()
try:
- pct = 100 * (float(curr_metrics['data']['tcp']["attemptfails"]) - float(last_metrics["data"]['tcp']["attemptfails"])) / ( float(curr_metrics['data']['tcp']['insegs']) - float(last_metrics['data']['tcp']['insegs']) )
+ pct = 100 * (float(curr_metrics['data']['tcp']["attemptfails"]) - float(last_metrics["data"]['tcp']["attemptfails"])) / (float(curr_metrics['data']['tcp']['outsegs']) + float(curr_metrics['data']['tcp']['insegs']) - float(last_metrics['data']['tcp']['insegs']) - float(last_metrics['data']['tcp']['outsegs']))
if pct < 0:
print name + " is less 0"
pct = 0
@@ -215,7 +215,7 @@ def metric_init(params):
descriptors.append(create_desc(Desc_Skel, {
"name" : "tcp_attemptfails_percentage",
"call_back" : get_tcpattemptfail_percentage,
- "description": "TCP attemptfail percentage, tcpattemptfail / insegs",
+ "description": "TCP attemptfail percentage, tcpattemptfail / insegs + outsegs",
"units" : "pct",
'groups' : 'tcpext'
}))

0 comments on commit dcd01ec

Please sign in to comment.
Something went wrong with that request. Please try again.