Révision 8fef176a
Add TITLE_PREFIX to redis_
| plugins/redis/redis_ | ||
|---|---|---|
| 40 | 40 |
my $HOST = exists $ENV{'host'} ? $ENV{'host'} : "127.0.0.1";
|
| 41 | 41 |
my $PORT = exists $ENV{'port'} ? $ENV{'port'} : 6379;
|
| 42 | 42 |
my $PASSWORD = exists $ENV{'password'} ? $ENV{'password'} : undef;
|
| 43 |
my $TITLE_PREFIX = exists $ENV{'title_prefix'} ? $ENV{'title_prefix'} . ": " : "";
|
|
| 43 | 44 |
|
| 44 | 45 |
my $sock = &get_conn(); |
| 45 | 46 |
my $config = ( defined $ARGV[0] and $ARGV[0] eq "config" ); |
| ... | ... | |
| 75 | 76 |
case "connected_clients" {
|
| 76 | 77 |
if ( $config ) {
|
| 77 | 78 |
my $maxclients= get_config("maxclients")->{"maxclients"};
|
| 78 |
print "graph_title Connected clients\n"; |
|
| 79 |
print "graph_title ${TITLE_PREFIX}Connected clients\n";
|
|
| 79 | 80 |
print "graph_vlabel Connected clients\n"; |
| 80 | 81 |
print "graph_category redis\n"; |
| 81 | 82 |
print "graph_args -l 0\n"; |
| ... | ... | |
| 90 | 91 |
|
| 91 | 92 |
case "keys_per_sec" {
|
| 92 | 93 |
if ( $config ) {
|
| 93 |
print "graph_title Keys Per Second\n"; |
|
| 94 |
print "graph_title ${TITLE_PREFIX}Keys Per Second\n";
|
|
| 94 | 95 |
print "graph_vlabel per \${graph_period}\n";
|
| 95 | 96 |
print "graph_category redis\n"; |
| 96 | 97 |
print "graph_args -l 0\n"; |
| ... | ... | |
| 113 | 114 |
|
| 114 | 115 |
case "key_ratio" {
|
| 115 | 116 |
if ( $config ) {
|
| 116 |
print "graph_title Key Hit vs Miss Ratio\n"; |
|
| 117 |
print "graph_title ${TITLE_PREFIX}Key Hit vs Miss Ratio\n";
|
|
| 117 | 118 |
print "graph_vlabel per \${graph_period}\n";
|
| 118 | 119 |
print "graph_category redis\n"; |
| 119 | 120 |
print "graph_args -u 100 -l 0 -r --base 1000\n"; |
| ... | ... | |
| 140 | 141 |
|
| 141 | 142 |
case "per_sec" {
|
| 142 | 143 |
if ( $config ) {
|
| 143 |
print "graph_title Per second\n"; |
|
| 144 |
print "graph_title ${TITLE_PREFIX}Per second\n";
|
|
| 144 | 145 |
print "graph_vlabel per \${graph_period}\n";
|
| 145 | 146 |
print "graph_category redis\n"; |
| 146 | 147 |
print "graph_args -l 0\n"; |
| ... | ... | |
| 159 | 160 |
case "used_memory" {
|
| 160 | 161 |
if ( $config ) {
|
| 161 | 162 |
my $maxmemory = get_config("maxmemory")->{"maxmemory"};
|
| 162 |
print "graph_title Used memory\n"; |
|
| 163 |
print "graph_title ${TITLE_PREFIX}Used memory\n";
|
|
| 163 | 164 |
print "graph_vlabel Used memory\n"; |
| 164 | 165 |
print "graph_category redis\n"; |
| 165 | 166 |
print "graph_args -l 0 --base 1024\n"; |
| ... | ... | |
| 184 | 185 |
} |
| 185 | 186 |
|
| 186 | 187 |
if ( $config ) {
|
| 187 |
print "graph_title Used keys\n"; |
|
| 188 |
print "graph_title ${TITLE_PREFIX}Used keys\n";
|
|
| 188 | 189 |
print "graph_vlabel Used keys\n"; |
| 189 | 190 |
print "graph_category redis\n"; |
| 190 | 191 |
print "graph_args -l 0\n"; |
Formats disponibles : Unified diff