Projet

Général

Profil

Révision 649eb446

ID649eb4465efc6aa5305aa35e6da2bfee671e6011
Parent 538cdc93
Enfant 17cebc60

Ajouté par eveiga il y a environ 12 ans

New riak plugin for get/put 95th percentile time

Commit includes: a new riak plugin to monitor the 95th percentile time between reception of client PUT/GET request and subsequent response to client.
The structure of the plugin is based on the two previously existing ones.

Voir les différences:

plugins/riak/riak_fsm_time_95
1
#!/usr/bin/python
2

  
3
# This is monitoring plugin for riak Developer's website: http://wiki.basho.com/Riak.html
4
# sample config in /etc/munin/plugin-conf.d/riak
5
#
6
# [riak_*]
7
# env.RIAK_URL http://127.0.0.1:8091/stats
8
#
9

  
10
import urllib2
11
import sys
12
import os
13

  
14
try:
15
    import json
16
except ImportError:
17
    import simplejson as json
18

  
19
def doData():
20
    raw = urllib2.urlopen(  os.environ.get('RIAK_URL', "http://127.0.0.1:8097/stats") ).read()
21
    stats = json.loads( raw )
22

  
23
    print "get_fsm_time_95.value " + str( stats["node_get_fsm_time_95"] )
24
    print "put_fsm_time_95.value " + str( stats["node_put_fsm_time_95"] )
25

  
26
def doConfig():
27
    print "graph_title 95th percentile of FSM time"
28
    print "graph_args --base 1000"
29
    print "graph_vlabel gets (-) puts (+) in ms"
30
    print "graph_category Riak"
31
    print "graph_info Response time, in milliseconds, met or beaten by 95% of riak_kv_get_fsm executions."
32

  
33
    print "get_fsm_time_95.label vnode_gets"
34
    print "get_fsm_time_95.graph no"
35
    print "get_fsm_time_95.type GAUGE"
36
    print "get_fsm_time_95.cdef get_fsm_time_95,1000,/"
37
    print "get_fsm_time_95.min 0"
38
    print "get_fsm_time_95.draw LINE1"
39

  
40
    print "put_fsm_time_95.label vnode gets/puts"
41
    print "put_fsm_time_95.type GAUGE"
42
    print "put_fsm_time_95.min 0"
43
    print "put_fsm_time_95.cdef put_fsm_time_95,1000,/"
44
    print "put_fsm_time_95.negative get_fsm_time_95"
45
    print "put_fsm_time_95.draw LINE1"
46

  
47
if __name__ == "__main__":
48
    if len(sys.argv) > 1 and sys.argv[1] == "config":
49
        doConfig()
50
    else:
51
        doData()

Formats disponibles : Unified diff