Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter stores the Uptime.com client configuration.
func New ¶
New takes an Uptime.com API token and returns a Reporter object which can then be used to query the Uptime API.
func (Reporter) GetDowntimes ¶
GetDowntimes takes the ID of a check, and two time values indicating the start and end of the period to query. It returns a Site object containing metadata about the site, plus the number of outages in the period, and the total amount of downtime in the period.
func (Reporter) GetDowntimesWithRetry ¶
GetDowntimesWithRetry calls GetDowntimes for the given ID. If there is an API rate limit error, it sleeps for a while and tries again, and keeps trying forever.
func (Reporter) GetSiteIDs ¶
GetSiteIDs returns a slice of check IDs, one for each check in the account associated with the Reporter's API token.
type Site ¶
Site represents metadata about an Uptime.com check, and can also store data on its outages and downtime within a specified period.
func SiteFromCheck ¶
func SiteFromCheck(c uptime.Check, s uptime.CheckStatsResponse) Site
SiteFromCheck translates from an uptime.Check and uptime.CheckStats object to a Site object containing the data from both objects.
type SiteSet ¶
type SiteSet []Site
SiteSet represents a slice of Sites.
func ReadCSV ¶
ReadCSV reads CSV data representing a group of Sites, one per line, from the given input.
func (SiteSet) BySector ¶
BySector operates on a SiteSet and returns a map of sectors to sites (that is, the map key is the sector name, and the corresponding value is the SiteSet of all the sites in that sector).
func (SiteSet) FilterDowntimeOver ¶
FilterDowntimeOver returns the set of sites with less than or equal to the specified amount of downtime, in seconds.
func (SiteSet) SortByDowntime ¶
func (ss SiteSet) SortByDowntime()
SortByDowntime sorts the SiteSet by downtime, highest first, then by outages, most outages first, and then by name alphabetically.
type Summary ¶
type Summary struct {
Sum, Mean, Dev, Min, Max, Median, Q1, Q3 float64
}
Summary represents the statistical summary data for a group of Sites.
func StatsSummary ¶
func StatsSummary(input stats.Float64Data) (Summary, error)
StatsSummary takes a dataset of floating-point values and calculates various statistical values for them, returning a Summary object containing the computed data.