diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8df86b2ff0..19ae2838681 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,7 @@ jobs: if: matrix.java == '8' run: | ./mvnw -T 4C clean test \ - -Dpmd.skip=false -Dlicense.skip=false -DredisCaseEnabled=true \ + -Dcheckstyle.skip=false -Dpmd.skip=false -Dlicense.skip=false -DredisCaseEnabled=true \ -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn; # step 5.2 - name: "Test with Maven and Java${{ matrix.java }}" diff --git a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java index 9863918f775..acdf6fa244c 100644 --- a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java +++ b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java @@ -80,7 +80,6 @@ public long count() { @Override public double tps() { - System.out.println("clock.getCurrentMilliseconds(): " + clock.getCurrentMilliseconds()); return this.value.getTps(clock.getCurrentMilliseconds()); } diff --git a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java index 5af273e3ce6..5cd13fe8a9b 100644 --- a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java +++ b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java @@ -38,15 +38,9 @@ public long getTotal() { } public double getTps(double currentMilliseconds) { - System.out - .println("currentMilliseconds: " + currentMilliseconds + " , startMilliseconds: " + startMilliseconds); if (currentMilliseconds <= startMilliseconds) { - System.out - .println("getTps: 0"); return 0; } - System.out - .println("total.doubleValue(): " + total.doubleValue() + " (currentMilliseconds - startMilliseconds) * 1000.0 " + (currentMilliseconds - startMilliseconds) * 1000.0); return total.doubleValue() / (currentMilliseconds - startMilliseconds) * 1000.0; } diff --git a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java index 0f53f2c745e..c93c99e6003 100644 --- a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java +++ b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java @@ -66,18 +66,11 @@ public void testCount() { @Test public void testTps() { - CompactSummary compactSummary = new CompactSummary(new Id("test")); - System.out.println("current: "+ System.currentTimeMillis()); - compactSummary.increase(51111); - System.out.println("tps: "+ compactSummary.tps()+", count: "+compactSummary.count()+ " ,total:"+compactSummary.total()); - compactSummary.increase(1111110); - System.out.println("tps: "+ compactSummary.tps()+", count: "+compactSummary.count()+ " ,total:"+compactSummary.total()); - compactSummary.increase(111115); - System.out.println("tps: "+ compactSummary.tps()+", count: "+compactSummary.count()+ " ,total:"+compactSummary.total()); + compactSummary.increase(5); + compactSummary.increase(10); + compactSummary.increase(15); // Assuming that the time taken is 1 second - System.out.println("tps time: "+ System.currentTimeMillis()); assertTrue(compactSummary.tps() >0); - System.out.println("tps endtime: "+ System.currentTimeMillis()); } @Test