From: paulfantom Date: Wed, 22 Jun 2016 15:55:46 +0000 (+0200) Subject: fixing problems with data formatting in apache and nginx X-Git-Tag: v1.3.0~106^2~4 X-Git-Url: https://arthur.barton.de/gitweb/?p=netdata.git;a=commitdiff_plain;h=923e9b871e6134578f781d5fc87f98f1c5428d0a fixing problems with data formatting in apache and nginx --- diff --git a/charts.d/apache.chart.sh b/charts.d/apache.chart.sh index a3e06409..681651a0 100755 --- a/charts.d/apache.chart.sh +++ b/charts.d/apache.chart.sh @@ -238,7 +238,7 @@ SET connections = $((apache_connstotal)) END BEGIN apache.conns_async $1 SET keepalive = $((apache_connsasynckeepalive)) -SET closing = $((apache_connsasyncwriting)) +SET closing = $((apache_connsasyncclosing)) SET writing = $((apache_connsasyncwriting)) END VALUESEOF2 diff --git a/python.d/apache.chart.py b/python.d/apache.chart.py index 41d7808a..b69972f3 100644 --- a/python.d/apache.chart.py +++ b/python.d/apache.chart.py @@ -18,14 +18,14 @@ retries = 5 # }} # charts order (can be overridden if you want less charts, or different order) -ORDER = ['bytesperreq', 'workers', 'reqpersec', 'bytespersec', 'requests', 'net', 'connections', 'conns_async'] +ORDER = ['requests', 'connections', 'conns_async', 'net', 'workers', 'reqpersec', 'bytespersec', 'bytesperreq'] CHARTS = { 'bytesperreq': { 'options': "'' 'apache Lifetime Avg. Response Size' 'bytes/request' statistics apache.bytesperreq area", 'lines': [ {"name": "size_req", - "options": "'' absolute 1"} + "options": "'' absolute 1 1000000"} ]}, 'workers': { 'options': "'' 'apache Workers' 'workers' workers apache.workers stacked", @@ -42,7 +42,7 @@ CHARTS = { "options": "'' absolute 1 1000000"} ]}, 'bytespersec': { - 'options': "'' 'apache Lifetime Avg. Response Size' 'bytes/request' statistics apache.bytesperreq area", + 'options': "'' 'apache Lifetime Avg. Bandwidth/s' 'kilbits/s' statistics apache.bytesperreq area", 'lines': [ {"name": "size_sec", "options": "'' absolute 8 1000000000"} @@ -108,7 +108,10 @@ class Service(UrlService): tmp = row.split(":") if str(tmp[0]) in self.assignment: try: - data[self.assignment[tmp[0]]] = int(float(tmp[1])) + multiplier = 1 + if tmp[0] in ("BytesPerReq", "ReqPerSec", "BytesPerSec"): + multiplier = 1000 + data[self.assignment[tmp[0]]] = int(float(tmp[1])*multiplier) except (IndexError, ValueError) as a: print(a) pass diff --git a/python.d/nginx.chart.py b/python.d/nginx.chart.py index 7fbaeb37..17c151f7 100644 --- a/python.d/nginx.chart.py +++ b/python.d/nginx.chart.py @@ -41,13 +41,13 @@ CHARTS = { {"name": "writing", "options": "'' absolute 1 1"}, {"name": "waiting", - "options": "'' absolute 1 1"} + "options": "idle absolute 1 1"} ]}, 'connect_rate': { 'options': "'' 'nginx Connections Rate' 'connections/s' nginx nginx.performance line", 'lines': [ {"name": "accepts", - "options": "'accepted' incremental 1 1"}, + "options": "accepted incremental 1 1"}, {"name": "handled", "options": "'' incremental 1 1"} ]} @@ -71,10 +71,10 @@ class Service(UrlService): try: return {'active': int(raw[2]), 'requests': int(raw[7]), - 'reading': int(raw[8]), - 'writing': int(raw[9]), - 'waiting': int(raw[11]), - 'accepts': int(raw[13]), - 'handled': int(raw[15])} + 'reading': int(raw[11]), + 'writing': int(raw[13]), + 'waiting': int(raw[15]), + 'accepts': int(raw[8]), + 'handled': int(raw[9])} except ValueError: return None diff --git a/web/index.html b/web/index.html index 3a84bba4..558127e4 100644 --- a/web/index.html +++ b/web/index.html @@ -1366,7 +1366,7 @@ var menuData = { info: undefined, }, - 'nginx': { +/* 'nginx': { title: 'nginx', info: undefined, }, @@ -1374,7 +1374,7 @@ var menuData = { 'apache': { title: 'Apache', info: undefined, - }, + },*/ 'named': { title: 'named', @@ -1816,8 +1816,8 @@ function enrichChartData(chart) { case 'mysql': case 'phpfpm': - case 'nginx': - case 'apache': +/* case 'nginx': + case 'apache':*/ case 'named': case 'cgroup': chart.menu = chart.type;