litespeed: add connections charts
lgz committed
Jun 5, 2018 at 10:48 UTC
36c4d39f20ad1ac2efa88ba69b6926ce0c42ed11
1 file changed
+24
-1
python.d/litespeed.chart.py
+24
-1
@@ -16,6 +16,7 @@ update_every = 10
16
# charts order (can be overridden if you want less charts, or different order)
17
ORDER = [
18
'net_throughput_http', 'net_throughput_https',
19
+ 'connections_http', 'connections_https',
20
'requests', 'pub_cache_hits', 'private_cache_hits', 'static_hits']
21
22
CHARTS = {
@@ -33,6 +34,20 @@ CHARTS = {
34
["ssl_bps_in", "in", "absolute"],
35
["ssl_bps_out", "out", "absolute", -1]
36
]},
37
+ 'connections_http': {
38
+ 'options': [
39
+ None, 'Connections HTTP', 'conns', 'connections', 'litespeed.connections', 'stack'],
40
+ 'lines': [
41
+ ["conn_free", "free", "absolute"],
42
+ ["conn_used", "used", "absolute"]
43
+ ]},
44
+ 'connections_https': {
45
+ 'options': [
46
+ None, 'Connections HTTPS', 'conns', 'connections', 'litespeed.connections', 'stack'],
47
+ 'lines': [
48
+ ["ssl_conn_free", "free", "absolute"],
49
+ ["ssl_conn_used", "used", "absolute"]
50
+ ]},
51
'requests': {
52
'options': [None, 'Requests', 'req/s', 'requests', 'litespeed.requests', 'line'],
53
'lines': [
@@ -66,6 +81,10 @@ T = [
81
t("PUB_CACHE_HITS_PER_SEC", "pub_cache_hits", 100),
82
t("PRIVATE_CACHE_HITS_PER_SEC", "private_cache_hits", 100),
83
t("STATIC_HITS_PER_SEC", "static_hits", 100),
84
+ t("PLAINCONN", "conn_used", 1),
85
+ t("AVAILCONN", "conn_free", 1),
86
+ t("SSLCONN", "ssl_conn_used", 1),
87
+ t("AVAILSSL", "ssl_conn_free", 1),
88
]
89
90
RE = re.compile(r'([A-Z_]+): ([0-9.]+)')
@@ -79,6 +98,10 @@ ZERO_DATA = {
98
"pub_cache_hits": 0,
99
"private_cache_hits": 0,
100
"static_hits": 0,
101
+ "conn_used": 0,
102
+ "conn_free": 0,
103
+ "ssl_conn_used": 0,
104
+ "ssl_conn_free": 0,
105
}
106
107
@@ -150,7 +173,7 @@ class Service(SimpleService):
173
174
def parse_file(data, lines):
175
for line in lines:
153
- if not line.startswith(("BPS_IN", "REQ_RATE []")):
176
+ if not line.startswith(("BPS_IN:", "MAXCONN:", "REQ_RATE []:")):
177
continue
178
m = dict(RE.findall(line))
179
for v in T: