Documentation ¶
Index ¶
- Variables
- type Store
- func (s *Store) Clear()
- func (s *Store) Close()
- func (s *Store) DeleteAllEndpointStatusesNotInKeys(keys []string) int
- func (s *Store) GetAllEndpointStatuses(params *paging.EndpointStatusParams) ([]*core.EndpointStatus, error)
- func (s *Store) GetAverageResponseTimeByKey(key string, from, to time.Time) (int, error)
- func (s *Store) GetEndpointStatus(groupName, endpointName string, params *paging.EndpointStatusParams) (*core.EndpointStatus, error)
- func (s *Store) GetEndpointStatusByKey(key string, params *paging.EndpointStatusParams) (*core.EndpointStatus, error)
- func (s *Store) GetHourlyAverageResponseTimeByKey(key string, from, to time.Time) (map[int64]int, error)
- func (s *Store) GetUptimeByKey(key string, from, to time.Time) (float64, error)
- func (s *Store) Insert(endpoint *core.Endpoint, result *core.Result) error
- func (s *Store) Save() error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrPathNotSpecified is the error returned when the path parameter passed in NewStore is blank ErrPathNotSpecified = errors.New("path cannot be empty") // ErrDatabaseDriverNotSpecified is the error returned when the driver parameter passed in NewStore is blank ErrDatabaseDriverNotSpecified = errors.New("database driver cannot be empty") )
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store that leverages a database
func NewStore ¶
NewStore initializes the database and creates the schema if it doesn't already exist in the path specified
func (*Store) DeleteAllEndpointStatusesNotInKeys ¶
DeleteAllEndpointStatusesNotInKeys removes all rows owned by an endpoint whose key is not within the keys provided
func (*Store) GetAllEndpointStatuses ¶
func (s *Store) GetAllEndpointStatuses(params *paging.EndpointStatusParams) ([]*core.EndpointStatus, error)
GetAllEndpointStatuses returns all monitored core.EndpointStatus 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) GetEndpointStatus ¶
func (s *Store) GetEndpointStatus(groupName, endpointName string, params *paging.EndpointStatusParams) (*core.EndpointStatus, error)
GetEndpointStatus returns the endpoint status for a given endpoint name in the given group
func (*Store) GetEndpointStatusByKey ¶
func (s *Store) GetEndpointStatusByKey(key string, params *paging.EndpointStatusParams) (*core.EndpointStatus, error)
GetEndpointStatusByKey returns the endpoint status for a given key
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) GetUptimeByKey ¶
GetUptimeByKey returns the uptime percentage during a time range