You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by vo...@apache.org on 2019/07/22 09:51:10 UTC

[rocketmq-exporter] 12/33: make value Integer if the metrics value greater than one

This is an automated email from the ASF dual-hosted git repository.

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

commit f1055976156cc853b3f0396f67da8c1b60b0ca1e
Author: fengqing <fe...@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;
     }
 }