aboutsummaryrefslogtreecommitdiff
path: root/go/stats
diff options
context:
space:
mode:
authorchrislusf <chris.lu@gmail.com>2015-03-22 12:50:04 -0700
committerchrislusf <chris.lu@gmail.com>2015-03-22 12:50:04 -0700
commit78bc7b393fee5206b6b4f8d8d2abdfe925a9647a (patch)
tree56c608f9bcd61d41e3a6b836c530a566942f0e94 /go/stats
parent23012deccf7366cb666b120598f4aadb1572674f (diff)
downloadseaweedfs-78bc7b393fee5206b6b4f8d8d2abdfe925a9647a.tar.xz
seaweedfs-78bc7b393fee5206b6b4f8d8d2abdfe925a9647a.zip
tweaking ui
Diffstat (limited to 'go/stats')
-rw-r--r--go/stats/duration_counter.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/go/stats/duration_counter.go b/go/stats/duration_counter.go
index 254a95fc7..50a8bce43 100644
--- a/go/stats/duration_counter.go
+++ b/go/stats/duration_counter.go
@@ -58,6 +58,20 @@ func (rrc *RoundRobinCounter) Sum() (sum int64) {
return
}
+func (rrc *RoundRobinCounter) ToList() (ret []int64) {
+ index := rrc.LastIndex
+ step := len(rrc.Values)
+ for step > 0 {
+ step--
+ index++
+ if index >= len(rrc.Values) {
+ index = 0
+ }
+ ret = append(ret, rrc.Values[index])
+ }
+ return
+}
+
type DurationCounter struct {
MinuteCounter *RoundRobinCounter
HourCounter *RoundRobinCounter