Fix rrd update when value less than 1
This commit is contained in:
parent
fb070a9843
commit
0d5ca9306e
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue