diff options
author | EUcancER <root@euer.krebsco.de> | 2012-06-02 01:14:05 +0200 |
---|---|---|
committer | EUcancER <root@euer.krebsco.de> | 2012-06-02 01:14:05 +0200 |
commit | d2f737473e3bbcb7592a6745820bccd333128459 (patch) | |
tree | 6c8cfb0f30db5995c0787bbe06f48b6735b65c89 /util/bin | |
parent | ff93336964b5c59bb2e7ddfb790884593d8276ba (diff) |
//retiolum adv_graphgen: now writing stats to graphite
painload now provides convenient tools to enable graphite stats generation
currently logged are:
- overall build time of graphs
- anon and detailed build times
- current number of users in the darknet
Diffstat (limited to 'util/bin')
-rwxr-xr-x | util/bin/statsc | 4 | ||||
-rwxr-xr-x | util/bin/timer | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/util/bin/statsc b/util/bin/statsc index ce2c70b6..ff86ccb8 100755 --- a/util/bin/statsc +++ b/util/bin/statsc @@ -1,4 +1,4 @@ #!/bin/sh # see https://github.com/etsy/statsd for syntax -[[ $# -eq 0 ]] && echo "usage: $0 MESSAGE" -echo "$1" | nc localhost 8126 +[ $# -eq 0 ] && echo "usage: $0 MESSAGE" +echo "$1" | nc -w 1 -u 127.0.0.1 8125 diff --git a/util/bin/timer b/util/bin/timer index 98c43063..0ccf514a 100755 --- a/util/bin/timer +++ b/util/bin/timer @@ -1,14 +1,14 @@ #!/bin/bash - +curr=$(date '+%s%N') +etime=${curr:0:${#curr}-6} if [[ $# -eq 0 ]];then - echo $(date '+%s') + echo $etime else - [ "$1" -eq "-h" -o "$1" -eq "--help" ] && \ - echo "usage: $0 [start_time]" && \ - echo " if no start_time is given, return the currentime" && \ - echo " if start_time is given, return the difference" + [ "$1" == "-h" -o "$1" == "--help" ] && \ + echo "usage: $0 [start_ms]" && \ + echo " if no start_ms is given, return the currentime" && \ + echo " if start_ms is given, return the difference" && exit 0 stime=$1 - etime=$(date '+%s') [[ -z "$stime" ]] && stime=$etime echo $((etime - stime)) fi |