mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-09 04:52:35 +02:00
metrics: fix 5m period
This commit is contained in:
parent
19e3392825
commit
10d23828a7
1 changed files with 3 additions and 1 deletions
|
@ -48,6 +48,8 @@ func (p *Period[T]) Get(filter Filter) []*T {
|
|||
p.mu.RLock()
|
||||
defer p.mu.RUnlock()
|
||||
switch filter {
|
||||
case PeriodFiveMinutes:
|
||||
return p.FiveMinutes.Get()
|
||||
case PeriodFifteenMinutes:
|
||||
return p.FifteenMinutes.Get()
|
||||
case PeriodOneHour:
|
||||
|
@ -63,7 +65,7 @@ func (p *Period[T]) Get(filter Filter) []*T {
|
|||
|
||||
func (filter Filter) IsValid() bool {
|
||||
switch filter {
|
||||
case PeriodFifteenMinutes, PeriodOneHour, PeriodOneDay, PeriodOneMonth:
|
||||
case PeriodFiveMinutes, PeriodFifteenMinutes, PeriodOneHour, PeriodOneDay, PeriodOneMonth:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
Loading…
Add table
Reference in a new issue