Documentation
¶
Index ¶
- func AddResult(ss *core.ServiceStatus, result *core.Result)
- func ShallowCopyServiceStatus(ss *core.ServiceStatus, params *paging.ServiceStatusParams) *core.ServiceStatus
- type Store
- func (s *Store) Clear()
- func (s *Store) Close()
- func (s *Store) DeleteAllServiceStatusesNotInKeys(keys []string) int
- func (s *Store) GetAllServiceStatuses(params *paging.ServiceStatusParams) ([]*core.ServiceStatus, error)
- func (s *Store) GetAverageResponseTimeByKey(key string, from, to time.Time) (int, error)
- func (s *Store) GetHourlyAverageResponseTimeByKey(key string, from, to time.Time) (map[int64]int, error)
- func (s *Store) GetServiceStatus(groupName, serviceName string, params *paging.ServiceStatusParams) (*core.ServiceStatus, error)
- func (s *Store) GetServiceStatusByKey(key string, params *paging.ServiceStatusParams) (*core.ServiceStatus, error)
- func (s *Store) GetUptimeByKey(key string, from, to time.Time) (float64, error)
- func (s *Store) Insert(service *core.Service, result *core.Result) error
- func (s *Store) Save() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddResult ¶
func AddResult(ss *core.ServiceStatus, result *core.Result)
AddResult adds a Result to ServiceStatus.Results and makes sure that there are no more than MaximumNumberOfResults results in the Results slice
func ShallowCopyServiceStatus ¶
func ShallowCopyServiceStatus(ss *core.ServiceStatus, params *paging.ServiceStatusParams) *core.ServiceStatus
ShallowCopyServiceStatus returns a shallow copy of a ServiceStatus with only the results within the range defined by the page and pageSize parameters
Types ¶
type Store ¶
Store that leverages gocache
func NewStore ¶
NewStore creates a new store using gocache.Cache
This store holds everything in memory, and if the file parameter is not blank, supports eventual persistence.
func (*Store) DeleteAllServiceStatusesNotInKeys ¶
DeleteAllServiceStatusesNotInKeys removes all ServiceStatus that are not within the keys provided
func (*Store) GetAllServiceStatuses ¶
func (s *Store) GetAllServiceStatuses(params *paging.ServiceStatusParams) ([]*core.ServiceStatus, error)
GetAllServiceStatuses returns all monitored core.ServiceStatus with a subset of core.Result defined by the page and pageSize parameters
func (*Store) GetAverageResponseTimeByKey ¶
GetAverageResponseTimeByKey returns the average response time in milliseconds (value) during a time range
func (*Store) GetHourlyAverageResponseTimeByKey ¶
func (s *Store) GetHourlyAverageResponseTimeByKey(key string, from, to time.Time) (map[int64]int, error)
GetHourlyAverageResponseTimeByKey returns a map of hourly (key) average response time in milliseconds (value) during a time range
func (*Store) GetServiceStatus ¶
func (s *Store) GetServiceStatus(groupName, serviceName string, params *paging.ServiceStatusParams) (*core.ServiceStatus, error)
GetServiceStatus returns the service status for a given service name in the given group
func (*Store) GetServiceStatusByKey ¶
func (s *Store) GetServiceStatusByKey(key string, params *paging.ServiceStatusParams) (*core.ServiceStatus, error)
GetServiceStatusByKey returns the service status for a given key
func (*Store) GetUptimeByKey ¶
GetUptimeByKey returns the uptime percentage during a time range