Added BPS.Data to feed to sparklines
This commit is contained in:
@@ -127,3 +127,12 @@ func (b *BPS) Close() {
|
||||
close(b.quit)
|
||||
<-b.closed
|
||||
}
|
||||
|
||||
// Data returns an slice of all the buckets, the most recent bucket first.
|
||||
func (b *BPS) Data() []int {
|
||||
r := []int{}
|
||||
for i := len(b.buckets) - 1; i >= 0; i-- {
|
||||
r = append(r, int(b.buckets[(b.timeI+i)%len(b.buckets)]))
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user