diff options
| author | chrislusf <chris.lu@gmail.com> | 2015-03-22 12:50:04 -0700 |
|---|---|---|
| committer | chrislusf <chris.lu@gmail.com> | 2015-03-22 12:50:04 -0700 |
| commit | 78bc7b393fee5206b6b4f8d8d2abdfe925a9647a (patch) | |
| tree | 56c608f9bcd61d41e3a6b836c530a566942f0e94 /go/stats | |
| parent | 23012deccf7366cb666b120598f4aadb1572674f (diff) | |
| download | seaweedfs-78bc7b393fee5206b6b4f8d8d2abdfe925a9647a.tar.xz seaweedfs-78bc7b393fee5206b6b4f8d8d2abdfe925a9647a.zip | |
tweaking ui
Diffstat (limited to 'go/stats')
| -rw-r--r-- | go/stats/duration_counter.go | 14 |
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 |
