Repository: huaweicloud/sermant
Issue: 【fix】fix the statics logic for request count

### What happened?

Redundant statistics for request count

### How can we reproduce it (as minimally and precisely as possible)?

always

### Anything else we need to know?

_No response_

### Sermant version

<details>
0.6.1
</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```
</details>


Changed files:
sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/test/java/com/huawei/discovery/entity/SimpleRequestRecorderTest.java
sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/entity/SimpleRequestRecorder.java

diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/entity/SimpleRequestRecorder.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/entity/SimpleRequestRecorder.java
index 13274605..65c66a95 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/entity/SimpleRequestRecorder.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/main/java/com/huawei/discovery/entity/SimpleRequestRecorder.java
@@ -48,16 +48,17 @@ public class SimpleRequestRecorder implements Recorder {
 
     @Override
     public void beforeRequest() {
+        if (!discoveryPluginConfig.isEnableRequestCount()) {
+            return;
+        }
         final long allRequest = allRequestCount.incrementAndGet();
         if (allRequest <= 0) {
             allRequestCount.set(0);
             LOGGER.info("SimpleRequestRecorder has over the max num of long, it has been reset to 0!");
         }
-        if (discoveryPluginConfig.isEnableRequestCount()) {
-            LOGGER.info(String.format(Locale.ENGLISH,
-                            "currentTime: %s request count handle by plugin is: %s",
-                    HttpConstants.currentTime(), allRequest));
-        }
+        LOGGER.info(String.format(Locale.ENGLISH,
+                "currentTime: %s request count handle by plugin is: %s",
+                HttpConstants.currentTime(), allRequest));
     }
 
     @Override
diff --git a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/test/java/com/huawei/discovery/entity/SimpleRequestRecorderTest.java b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/test/java/com/huawei/discovery/entity/SimpleRequestRecorderTest.java
index b95e77ed..16431e19 100644
--- a/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/test/java/com/huawei/discovery/entity/SimpleRequestRecorderTest.java
+++ b/sermant-plugins/sermant-springboot-registry/springboot-registry-plugin/src/test/java/com/huawei/discovery/entity/SimpleRequestRecorderTest.java
@@ -46,6 +46,7 @@ public class SimpleRequestRecorderTest {
     public void setUp() throws Exception {
         pluginConfigManagerMockedStatic = Mockito
                 .mockStatic(PluginConfigManager.class);
+        discoveryPluginConfig.setEnableRequestCount(true);
         pluginConfigManagerMockedStatic.when(() -> PluginConfigManager.getPluginConfig(DiscoveryPluginConfig.class))
                 .thenReturn(discoveryPluginConfig);
     }