提交 0d5ca930 编写于 作者: 7 710leo

Fix rrd update when value less than 1

上级 fb070a98
......@@ -90,6 +90,12 @@ func (ll *SafeLinkedList) HistoryData(limit int) ([]*dataobj.HistoryData, bool)
currentElement := firstElement
for i < limit {
nextElement := currentElement.Next()
if nextElement == nil {
isEnough = false
return vs, isEnough
}
vs[i] = &dataobj.HistoryData{
Timestamp: nextElement.Value.(*dataobj.JudgeItem).Timestamp,
Value: dataobj.JsonFloat(nextElement.Value.(*dataobj.JudgeItem).Value),
......
......@@ -47,7 +47,7 @@ func update(filename string, items []*dataobj.TsdbItem) error {
if v > 1e+300 || (v < 1e-300 && v > 0) {
continue
}
u.Cache(item.Timestamp, int(item.Value))
u.Cache(item.Timestamp, item.Value)
}
return u.Update()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册