mirror of
https://github.com/pstadler/metrics.sh.git
synced 2025-11-08 21:24:54 -05:00
implement parallel collecting. add keen_io reporter. several fixes
This commit is contained in:
21
lib/main.sh
21
lib/main.sh
@@ -73,17 +73,22 @@ main_collect () {
|
||||
}
|
||||
|
||||
# collect metrics
|
||||
while true; do
|
||||
for metric in ${__METRICS[@]}; do
|
||||
if ! is_function __m_${metric}_collect; then
|
||||
continue
|
||||
fi
|
||||
for metric in ${__METRICS[@]}; do
|
||||
if ! is_function __m_${metric}_collect; then
|
||||
continue
|
||||
fi
|
||||
|
||||
fork () {
|
||||
__m_${metric}_collect
|
||||
done
|
||||
|
||||
sleep $INTERVAL
|
||||
sleep $INTERVAL
|
||||
fork
|
||||
}
|
||||
fork &
|
||||
unset -f fork
|
||||
done
|
||||
|
||||
# run forever
|
||||
tail -f /dev/null # `sleep infinity` is not portable
|
||||
}
|
||||
|
||||
main_terminate () {
|
||||
|
||||
Reference in New Issue
Block a user