Explorar el Código

重构了一下磁盘空间检测代码

stanley-king hace 3 años
padre
commit
5e16a0ec2b
Se han modificado 3 ficheros con 11 adiciones y 19 borrados
  1. 0 2
      helper/statistics/stlog.php
  2. 10 6
      test/TestAccountDivert.php
  3. 1 11
      util/arw_monitor.sh

+ 0 - 2
helper/statistics/stlog.php

@@ -68,8 +68,6 @@ class request
 
     private function record()
     {
-        $x = 0;
-
     }
 
     private function reqtype($time,$content)

+ 10 - 6
test/TestAccountDivert.php

@@ -24,12 +24,20 @@ class TestAccountDivert extends TestCase
         $helper = new refill\divert_account();
         $helper->init_member(65999);
     }
+
+    //docker-compose run php php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccountDivert::testInitMerchants)( .*)?$/" --test-suffix TestAccountDivert.php /var/www/html/test
     public function testInitMerchants()
     {
         $helper = new refill\divert_account();
         $helper->init_merchants();
     }
-    //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccountDivert::testInitMerchants)( .*)?$/" --test-suffix TestAccountDivert.php /var/www/html/test
+    //docker-compose run php php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccountDivert::testInitChannels)( .*)?$/" --test-suffix TestAccountDivert.php /var/www/html/test
+    public function testInitChannels()
+    {
+        $helper = new refill\divert_account();
+        $helper->init_channels();
+    }
+
     public function testDivertMember()
     {
         $helper = new refill\divert_account();
@@ -53,11 +61,7 @@ class TestAccountDivert extends TestCase
         }
     }
 
-    public function testInitChannels()
-    {
-        $helper = new refill\divert_account();
-        $helper->init_channels();
-    }
+
 
     //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccountDivert::testInitChannels)( .*)?$/" --test-suffix TestAccountDivert.php /var/www/html/test
     public function testInitChannelsAccount()

+ 1 - 11
util/arw_monitor.sh

@@ -3,15 +3,9 @@
 source /etc/profile
 
 cur_time=$(date "+%Y-%m-%d-%H-%M-%S")
-echo $cur_time "-1" >> /mnt/xyzshop/util/a.log
-
 df_dirs=(${XYZ_DF_DIRS//:/ })
 du_dirs=(${XYZ_DU_DIRS//:/ })
 
-echo $cur_time "-2" >> /mnt/xyzshop/util/a.log
-echo $XYZ_DF_DIRS "-2" >> /mnt/xyzshop/util/a.log
-echo $cur_time "-2" >> /mnt/xyzshop/util/a.log
-
 declare -A reports
 reports=(['cur_time']=$cur_time)
 
@@ -37,9 +31,7 @@ function du_check() {
 }
 
 df_check
-echo $cur_time "-3" >> /mnt/xyzshop/util/a.log
 du_check
-echo $cur_time "-4" >> /mnt/xyzshop/util/a.log
 
 str_report=''
 for key in $(echo ${!reports[*]})
@@ -47,8 +39,6 @@ do
     str_report="$str_report#$key:${reports[$key]}"
 done
 
-echo $str_report >> /mnt/xyzshop/util/a.log
 redis_host=$XYZ_REDIS_HOST
 netip=$XYZ_NETIP
-echo "HSET nc_disk_monitor $netip '$str_report'" | redis-cli -h $redis_host -p 6379
-echo $cur_time "-6" >> /mnt/xyzshop/util/a.log
+echo "HSET nc_disk_monitor $netip '$str_report'" | redis-cli -h $redis_host -p 6379