mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
21 lines
585 B
Bash
Executable File
21 lines
585 B
Bash
Executable File
#!/bin/bash
|
|
|
|
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}"
|
|
INTERVAL=750
|
|
|
|
last=$(date +"%F %T" -d "$INTERVAL seconds ago")
|
|
while true;
|
|
do
|
|
now=$(date +"%F %T")
|
|
|
|
journalctl -u bisq-pricenode --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
|