mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
794302678d
* Install script for collectd * Install script for network size metric * Apply suggestions from code review Co-Authored-By: wiz <j@wiz.biz> * Update monitor/install_collectd_debian.sh Co-Authored-By: wiz <j@wiz.biz> * Apply suggestions from code review Co-Authored-By: wiz <j@wiz.biz> Co-authored-by: wiz <j@wiz.biz>
21 lines
573 B
Bash
Executable File
21 lines
573 B
Bash
Executable File
#!/bin/sh
|
|
|
|
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}"
|
|
INTERVAL=750
|
|
|
|
last=$(date +"%F %T" -d "$INTERVAL seconds ago")
|
|
while true;
|
|
do
|
|
now=$(date +"%F %T")
|
|
|
|
journalctl -u bisq --since="$last" --until="$now" | grep -Eo "getAllMarketPrices.*bisq/[0-9].[0-9].[0-9]" | cut -d / -f 2 | sort | uniq -c | while read -r line; do
|
|
number=$(echo "${line}" | cut -d ' ' -f 1);
|
|
version=$(echo "${line}" | cut -d \ -f 2);
|
|
version=${version//./_};
|
|
echo "PUTVAL $HOSTNAME/requestsPer750Seconds/gauge-v$version interval=$INTERVAL N:$number";
|
|
done
|
|
last=$now
|
|
|
|
sleep $INTERVAL
|
|
done
|