Browse Source

增加控制接口控制insert是否显示统计信息

sensordb2 1 year ago
parent
commit
95399c7c28

+ 11 - 0
insert-app/src/main/java/db/controller/StatisticController.java

@@ -22,4 +22,15 @@ public class StatisticController {
         log.info("收到statistic请求");
         return statisticService.getStatistic().toString()+"\n";
     }
+    @RequestMapping("/logShowStatistic")
+    public String logShowStatistic(@RequestParam String mode) {
+        log.info("收到logShowStatistic请求");
+        if("enable".equals(mode)) {
+            statisticService.setShowStatisticAfterInsertData(true);
+        }
+        else {
+            statisticService.setShowStatisticAfterInsertData(false);
+        }
+        return "成功";
+    }
 }

+ 1 - 1
shell/insert/insert.sh

@@ -47,7 +47,7 @@ stop(){
   echo ">>> APP PID = $pidf begin kill $pidf <<<"
   kill $pidf
   rm -rf $PID
-  sleep 5
+  sleep 3
   is_exist
   if [ $? -eq "0" ]; then
     echo ">>> api 2 PID = $pid begin kill -9 $pid  <<<"

+ 8 - 0
shell/manage/disableLogStatistic.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+HOST=127.0.0.1
+PORT=8081
+echo start to disable log statistic
+#curl http://$HOST:$PORT/manage/logShowStatistic?mode=enable
+curl http://$HOST:$PORT/manage/logShowStatistic?mode=disable
+echo "end"

+ 8 - 0
shell/manage/enableLogStatistic.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+HOST=127.0.0.1
+PORT=8081
+echo start to enable log statistic
+curl http://$HOST:$PORT/manage/logShowStatistic?mode=enable
+#curl http://$HOST:$PORT/manage/logShowStatistic?mode=disable
+echo "end"

+ 1 - 1
shell/query/query.sh

@@ -47,7 +47,7 @@ stop(){
   echo ">>> APP PID = $pidf begin kill $pidf <<<"
   kill $pidf
   rm -rf $PID
-  sleep 10
+  sleep 3
   is_exist
   if [ $? -eq "0" ]; then
     echo ">>> api 2 PID = $pid begin kill -9 $pid  <<<"