diff options
author | maximesson <maxime.bonneau@est.tech> | 2019-08-30 14:05:15 +0000 |
---|---|---|
committer | Daniel Rose <dr695h@att.com> | 2019-09-09 14:55:34 +0000 |
commit | 69311bf8082471be45574c9a99b23e31e606669c (patch) | |
tree | c005c78aca429a7f09806de6a610b0b03e32de21 /test/mocks/datafilecollector-testharness/simulator-group/dfc-internal-stats.sh | |
parent | 6a5ec681a93a0ddf55080f164187791ed92578be (diff) |
Updated README files and adaptation of consul/cbs config
Change-Id: I81494f56978a3d0ff06ec0d66968f33f08114103
Issue-ID: DCAEGEN2-1719
Signed-off-by: maximesson <maxime.bonneau@est.tech>
Diffstat (limited to 'test/mocks/datafilecollector-testharness/simulator-group/dfc-internal-stats.sh')
-rwxr-xr-x | test/mocks/datafilecollector-testharness/simulator-group/dfc-internal-stats.sh | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/dfc-internal-stats.sh b/test/mocks/datafilecollector-testharness/simulator-group/dfc-internal-stats.sh index 9fbe9615c..e0d7c33b7 100755 --- a/test/mocks/datafilecollector-testharness/simulator-group/dfc-internal-stats.sh +++ b/test/mocks/datafilecollector-testharness/simulator-group/dfc-internal-stats.sh @@ -34,7 +34,7 @@ else print_usage exit 1 fi -fileoutput="./.tmp_stats.txt" +fileoutput=".tmp_stats.txt" echo "Stats piped to file: "$fileoutput @@ -75,29 +75,41 @@ do_curl_status() { } +OK=0 # Flag for DFC response (0==no response, 1==reponse ok and logging can start) while [ true ]; do - if [ $heading -eq 1 ]; then - echo -n "date" >> $fileoutput - else - ds=$(date) - echo -n $ds >> $fileoutput - fi - if [ $stat == "all" ] || [ $stat == "jvm" ]; then - echo "========= DFC JVM Stats =========" - do_curl_actuator jvm.threads.live - do_curl_actuator jvm.threads.peak - do_curl_actuator process.files.open - do_curl_actuator process.files.max - do_curl_actuator jvm.memory.used - do_curl_actuator jvm.memory.max - fi + if [ $OK -eq 0 ]; then + test=$(curl -s localhost:${dfcport}/status) + if [ -z "$test" ] && [ $heading -eq 1 ]; then + echo "No response from dfc on port: ${dfcport}. Retrying..." + else + echo "Response from dfc on port: ${dfcport}. Starts logging." + OK=1 + fi + fi + if [ $OK -eq 1 ]; then + if [ $heading -eq 1 ]; then + echo -n "date" >> $fileoutput + else + ds=$(date) + echo -n $ds >> $fileoutput + fi + if [ $stat == "all" ] || [ $stat == "jvm" ]; then + echo "========= DFC JVM Stats =========" + do_curl_actuator jvm.threads.live + do_curl_actuator jvm.threads.peak + do_curl_actuator process.files.open + do_curl_actuator process.files.max + do_curl_actuator jvm.memory.used + do_curl_actuator jvm.memory.max + fi - if [ $stat == "all" ] || [ $stat == "internal" ]; then - echo "========= DFC internal Stats =========" - do_curl_status - fi - echo "" >> $fileoutput - heading=0 + if [ $stat == "all" ] || [ $stat == "internal" ]; then + echo "========= DFC internal Stats =========" + do_curl_status + fi + echo "" >> $fileoutput + heading=0 + fi sleep 5 done
\ No newline at end of file |