forked from MatthiasLohr/munin-plugins-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitlab_redis_keys_per_sec
executable file
·32 lines (26 loc) · 1.01 KB
/
gitlab_redis_keys_per_sec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
# inspired by the redis munin plugin found at
# http://munin-monitoring.org/browser/munin-contrib/plugins/redis/redis_,
# written 2009 by Gleb Voronich <http://stanly.net.ua/>
from lib import get_gitlab_instance
import sys
if len(sys.argv) >= 2 and sys.argv[1] == 'config':
print('graph_title Redis: Keys Per Second')
print('graph_vlabel per ${graph_period}')
print('graph_category gitlab')
print('graph_args -l 0')
print('hits.label hits')
print('hits.type COUNTER')
print('misses.label misses')
print('misses.type COUNTER')
print('expired.label expirations')
print('expired.type COUNTER')
print('evictions.label evictions')
print('evictions.type COUNTER')
sys.exit(0)
gitlab = get_gitlab_instance()
redis_info = gitlab.get_redis_info()
print('hits.value ' + redis_info['keyspace_hits'])
print('misses.value ' + redis_info['keyspace_misses'])
print('expired.value ' + redis_info['expired_keys'])
print('evictions.value ' + redis_info['evicted_keys'])