* 优化只保留5位小数 * 优化小数点保留方法
@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"math"
"strconv"
"strings"
"time"
@ -52,6 +53,8 @@ func (m *FalconMetric) Clean(ts int64) error {
return fmt.Errorf("unparseable value %v", v)
}
m.Value = math.Round(m.Value*100000) / 100000
// if timestamp bigger than 32 bits, likely in milliseconds
if m.Timestamp > 0xffffffff {
m.Timestamp /= 1000
@ -52,6 +53,8 @@ func (m *HTTPMetric) Clean(ts int64) error {