rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wlliqip...@apache.org
Subject [rocketmq-exporter] 12/43: make value Integer if the metrics value greater than one
Date Sun, 08 Mar 2020 13:16:32 GMT
This is an automated email from the ASF dual-hosted git repository.

wlliqipeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-exporter.git

commit f1055976156cc853b3f0396f67da8c1b60b0ca1e
Author: fengqing <fengqing@sunlands.com>
AuthorDate: Tue Jul 2 20:30:27 2019 +0800

    make value Integer if the metrics value greater than one
---
 src/main/java/org/apache/rocketmq/exporter/util/Mix.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/java/org/apache/rocketmq/exporter/util/Mix.java b/src/main/java/org/apache/rocketmq/exporter/util/Mix.java
index e51acff..469be71 100644
--- a/src/main/java/org/apache/rocketmq/exporter/util/Mix.java
+++ b/src/main/java/org/apache/rocketmq/exporter/util/Mix.java
@@ -19,6 +19,9 @@ package org.apache.rocketmq.exporter.util;
 
 public class Mix {
     public static double getFixedDouble(double value) {
+        if (value >= 1) {
+            return Math.round(value);
+        }
         return Math.round(value * 100) / 100.0;
     }
 }


Mime
View raw message