sampler-fork/config.yml

109 lines
2.9 KiB
YAML

runcharts:
- title: SEARCH ENGINE RESPONSE TIME (sec)
position: [[0, 0], [52, 16]]
triggers:
- title: Latency threshold exceeded
condition: echo "$prev < 0.8 && $cur > 0.8" |bc -l
actions:
terminal-bell: true
sound: true
visual: true
script: 'say alert: ${label} latency exceeded ${cur} second'
scale: 3
items:
- label: GOOGLE
sample: curl -o /dev/null -s -w '%{time_total}' https://www.google.com
- label: YAHOO
sample: curl -o /dev/null -s -w '%{time_total}' https://search.yahoo.com
- label: BING
sample: curl -o /dev/null -s -w '%{time_total}' https://www.bing.com
- title: MONGO COLLECTIONS COUNT
position: [[53, 0], [27, 8]]
legend:
enabled: true
details: false
scale: 0
items:
- label: ACTIVE
init: mongo --quiet --host=localhost blog
sample: db.getCollection('posts').find({status:'ACTIVE'}).itcount()
transform: $sample | grep cpu
- label: INACTIVE
sample: mongo --quiet --host=localhost blog --eval "db.getCollection('posts').find({status:'INACTIVE'}).itcount()"
barcharts:
- title: EVENTS BY STATUS
position: [[0, 17], [27, 12]]
rate-ms: 300
scale: 0
items:
- label: NEW
init: mongo --quiet --host=localhost blog
sample: db.getCollection('posts').find({status:'ACTIVE'}).itcount()
- label: TRIGGERED
init: mongo --quiet --host=localhost blog
sample: db.getCollection('posts').find({status:'INACTIVE'}).itcount()
- label: IN_PROCESS
sample: echo 0
- label: FAILED
init: mongo --quiet --host=localhost blog
sample: db.getCollection('posts').find({status:'ACTIVE'}).itcount()
- label: FINISHED
init: mongo --quiet --host=localhost blog
sample: db.getCollection('posts').find({status:'INACTIVE'}).itcount()
gauges:
- title: YEAR PROGRESS
position: [[53, 8], [27, 2]]
cur:
sample: date +%j
max:
sample: echo 365
min:
sample: echo 0
- title: DAY PROGRESS
position: [[53, 10], [27, 2]]
cur:
sample: date +%H
max:
sample: echo 24
min:
sample: echo 0
- title: HOUR PROGRESS
position: [[53, 12], [27, 2]]
cur:
sample: date +%M
max:
sample: echo 60
min:
sample: echo 0
- title: MINUTE PROGRESS
position: [[53, 14], [27, 2]]
triggers:
- title: CLOCK BELL EVERY MINUTE
condition: '[ $label == "cur" ] && [ $cur -eq 0 ] && echo 1 || echo 0'
actions:
sound: true
script: say -v samantha `date +%I:%M%p`
cur:
sample: date +%S
max:
sample: echo 60
min:
sample: echo 0
asciiboxes:
- title: LOCAL TIME
position: [[53, 17], [27, 5]]
sample: date +%r
- title: UTC TIME
position: [[53, 22], [27, 7]]
sample: env TZ=UTC date +%r
font: 3d
sparklines:
- title: CPU usage
position: [[27, 22], [25, 7]]
scale: 0
sample: ps -A -o %cpu | awk '{s+=$1} END {print s}'
- title: Memory pages free
position: [[27, 17], [25, 5]]
scale: 0
sample: memory_pressure | grep 'Pages free' | awk '{print $3}'