Added support for MSE (Massive Storage Engine) in Varnish-Plus (#10317)
Ernesto J. Perez Garcia committed
Dec 4, 2020 at 00:24 UTC
9a52c6a71e996a31722c81a8d2ae882d490fe04e
2 files changed
+16
-9
collectors/python.d.plugin/varnish/README.md
+4
-3
@@ -6,8 +6,9 @@ sidebar_label: "Varnish Cache"
6
7
# Varnish Cache monitoring with Netdata
8
9
-Provides HTTP accelerator global, backends (VBE) and disks (SMF) statistics using `varnishstat` tool.
9
+Provides HTTP accelerator global, Backends (VBE) and Storages (SMF, SMA, MSE) statistics using `varnishstat` tool.
10
11
+Note that both, Varnish-Cache (free and open source) and Varnish-Plus (Commercial/Enterprise version), are supported.
12
13
## Requirements
14
@@ -36,9 +37,9 @@ For every backend (VBE):
37
38
- Backend Response Statistics in `kilobits/s`
39
39
-For every disk (SMF):
40
+For every storage (SMF, SMA, or MSE):
41
41
-- Disk Usage in `KiB`
42
+- Storage Usage in `KiB`
43
44
## Configuration
45
collectors/python.d.plugin/varnish/varnish.chart.py
+12
-6
@@ -227,7 +227,7 @@ class Service(ExecutableService):
227
self.parser = Parser()
228
self.command = None
229
self.collected_vbe = set()
230
- self.collected_smf_sma = set()
230
+ self.collected_storages = set()
231
232
def create_command(self):
233
varnishstat = find_binary(VARNISHSTAT)
@@ -298,7 +298,7 @@ class Service(ExecutableService):
298
data.update(stats)
299
300
self.get_vbe_backends(data, raw)
301
- self.get_smf_sma_storages(server_stats)
301
+ self.get_storages(server_stats)
302
303
# varnish 5 uses default.g_bytes and default.g_space
304
data['memory_allocated'] = data.get('s0.g_bytes') or data.get('default.g_bytes')
@@ -320,7 +320,13 @@ class Service(ExecutableService):
320
self.collected_vbe.add(name)
321
self.add_backend_charts(name)
322
323
- def get_smf_sma_storages(self, server_stats):
323
+ def get_storages(self, server_stats):
324
+ # Storage types:
325
+ # - SMF: File Storage
326
+ # - SMA: Malloc Storage
327
+ # - MSE: Massive Storage Engine (Varnish-Plus only)
328
+ #
329
+ # Stats example:
330
# [('SMF.', 'ssdStorage.c_req', '47686'),
331
# ('SMF.', 'ssdStorage.c_fail', '0'),
332
# ('SMF.', 'ssdStorage.c_bytes', '668102656'),
@@ -331,14 +337,14 @@ class Service(ExecutableService):
337
# ('SMF.', 'ssdStorage.g_smf', '40130'),
338
# ('SMF.', 'ssdStorage.g_smf_frag', '311'),
339
# ('SMF.', 'ssdStorage.g_smf_large', '66')]
334
- storages = [name for typ, name, _ in server_stats if typ.startswith(('SMF', 'SMA')) and name.endswith('g_space')]
340
+ storages = [name for typ, name, _ in server_stats if typ.startswith(('SMF', 'SMA', 'MSE')) and name.endswith('g_space')]
341
if not storages:
342
return
343
for storage in storages:
344
storage = storage.split('.')[0]
339
- if storage in self.collected_smf_sma:
345
+ if storage in self.collected_storages:
346
continue
341
- self.collected_smf_sma.add(storage)
347
+ self.collected_storages.add(storage)
348
self.add_storage_charts(storage)
349
350
def add_backend_charts(self, backend_name):