statping/types/services/hits.go

27 lines
462 B
Go
Raw Normal View History

2020-03-04 10:29:00 +00:00
package services
import (
2020-03-09 18:17:55 +00:00
"github.com/statping/statping/types/hits"
2020-03-04 10:29:00 +00:00
"time"
)
func (s *Service) HitsColumnID() (string, int64) {
return "service", s.Id
}
2020-03-06 09:33:46 +00:00
func (s *Service) FirstHit() *hits.Hit {
return hits.AllHits(s).First()
}
func (s *Service) LastHit() *hits.Hit {
return hits.AllHits(s).Last()
}
2020-03-04 10:29:00 +00:00
func (s *Service) AllHits() hits.Hitters {
return hits.AllHits(s)
}
func (s *Service) HitsSince(t time.Time) hits.Hitters {
2020-03-10 05:24:35 +00:00
return hits.Since(t, s)
2020-03-04 10:29:00 +00:00
}