/scripts

General place for scripts

Primary LanguageShell

dopStats.sh

This script will request, parse, and output doppler throughput and drops per instance in a table on the screen. (tip: use watch for it to update in real time.) It requires the log-cache cli. Just be sure your cf cli is authenticated and you have the proper scopes. (Note - if you have doppler.firehose or logs.admin scope - it will skip the log-cache permission check leading to faster and more efficient running of the script.) Pic

For readAllCounters and resetAllCounters

// to reset all counters in the nozzles.

for i in {0..<NUMBER INSTANCES OF COUNTERNOZZLE - 1>}
do
curl <COUNTERNOZZLE.APPS-DOMAIN>/reset -H "X-Cf-App-Instance":"<CounterNozzle GUID>:$i"
done

//To sum all counternozzle counters

export CURRENT_COUNTERNOZZLE_TOTAL=0
for i in {0..<NUMBER INSTANCES OF COUNTERNOZZLE - 1>}
do
INSTANCE_TOTAL=`curl -s COUNTERNOZZLE.APPS-DOMAIN/read -H "X-Cf-App-Instance":"<CounterNozzle GUID>:$i"`
CURRENT_COUNTERNOZZLE_TOTAL=`echo "${INSTANCE_TOTAL} + $CURRENT_COUNTERNOZZLE_TOTAL" | bc`
done
echo $CURRENT_COUNTERNOZZLE_TOTAL