updown

package
v0.0.0-...-f98e46b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByResponseTime

type ByResponseTime struct {
	Under125  uint `json:"under125"`
	Under250  uint `json:"under250"`
	Under500  uint `json:"under500"`
	Under1000 uint `json:"under1000"`
	Under2000 uint `json:"under2000"`
	Under4000 uint `json:"under4000"`
}

ByResponseTime is a type that represents the ByResponseTime subtype of Requests

func (*ByResponseTime) ToBuckets

func (x *ByResponseTime) ToBuckets() map[float64]uint64

ToBuckets is a method that converts ByResponseTIme structs into Prometheus buckets

type Check

type Check struct {
	Token             string   `json:"token"`
	URL               string   `json:"url"`
	Alias             string   `json:"alias"`
	LastStatus        uint16   `json:"last_status"`
	Uptime            float32  `json:"uptime"`
	Down              bool     `json:"down"`
	DownSince         string   `json:"down_since"`
	Error             string   `json:"error"`
	Period            uint     `json:"period"`
	ApdexThreshold    float32  `json:"apdex_t"`
	Enabled           bool     `json:"enabled"`
	Published         bool     `json:"published"`
	DisabledLocations []string `json:"disabled_locations"`
	Recipients        []string `json:"recipients"`
	LastCheckAt       string   `json:"last_check_at"`
	NextCheckAt       string   `json:"next_check_at"`
	SSL               SSL      `json:"ssl"`
}

Check is a type that represents an updown Check

type Client

type Client struct {
	APIKey string
	Client *http.Client
	Log    logr.Logger
}

Client is a type that represents an updown (REST) client

func NewClient

func NewClient(apiKey string, log logr.Logger) *Client

NewClient is a function that returns a new Client

func (*Client) GetCheckMetrics

func (c *Client) GetCheckMetrics(token string) (Metrics, error)

GetCheckMetrics is a method that returns a list of updown metrics for a check The method implemnents updown's /api/checks/:token/metrics See: https://updown.io/api#GET-/api/checks/:token/metrics

func (*Client) GetChecks

func (c *Client) GetChecks() ([]Check, error)

GetChecks is a method that returns a list of updown checks The method implements updown's /api/checks method See: https://updown.io/api#GET-/api/checks

type Metrics

type Metrics struct {
	Apdex    float32  `json:"apdex"`
	Requests Requests `json:"requests"`
	Timings  Timings  `json:"timings"`
}

Metrics is a type that an updown Check's metrics

type Requests

type Requests struct {
	Samples        uint           `json:"samples"`
	Failures       uint           `json:"failures"`
	Satisfied      uint           `json:"satisfied"`
	Tolerated      uint           `json:"tolerated"`
	ByResponseTime ByResponseTime `json:"by_response_time"`
}

Requests is a type that represents the Requests subtype of updown Metrics

type SSL

type SSL struct {
	TestedAt  string `json:"tested_at"`
	ExpiresAt string `json:"expires_at"`
	Valid     bool   `json:"valid"`
	Error     string `json:"error"`
}

SSL is a type that represents the SSL subtype of an updown Check

type Timings

type Timings struct {
	Redirect   uint `json:"redirect"`
	NameLookup uint `json:"namelookup"`
	Connection uint `json:"connection"`
	Handshake  uint `json:"handshake"`
	Response   uint `json:"response"`
	Total      uint `json:"total"`
}

Timings is a type that represents the Timings subtype of updown Metrics

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL