canary

package module
v3.0.0-...-98f99b6 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2015 License: MIT Imports: 5 Imported by: 0

README

canary

GoDoc Build Status MIT License

open monitoring for the open web.

canaryio/canary is the spiritual successor to canaryio/sensord and canaryio/canaryd.

You can read about the initial roadmap here.

components

  • canary - a cli tool that behaves in a similar fashion to ping
  • canaryd - a more complex server process designed to monitor more than one website

Documentation

Index

Constants

View Source
const Version string = "v3"

the public version of canary

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	Targets []Target
}

Manifest represents configuration data.

func GetManifest

func GetManifest(url string) (manifest Manifest, err error)

GetManifest retreives a manifest from a given URL.

type Measurement

type Measurement struct {
	Target Target
	Sample Sample
	Error  error
}

Measurement reprents an aggregate of Target, Sample and error.

type Publisher

type Publisher interface {
	Publish(Measurement) error
}

Publisher is the interface that adds the Publish method.

Pubilsh takes a Target, and Sample, and an error, and is expected to deliver that data somewhere.

type Sample

type Sample struct {
	StatusCode int
	T1         time.Time
	T2         time.Time
}

Sample represents HTTP state from a given point in time.

func (Sample) Latency

func (s Sample) Latency() float64

Latency returns the amount of milliseconds between T1 and T2 (start and finish).

type Sampler

type Sampler interface {
	Sample(Target) (Sample, error)
}

A Sampler is an interface that provides the Sample method.

type Scheduler

type Scheduler struct {
	Target  Target
	C       chan Measurement
	Sampler Sampler
	// contains filtered or unexported fields
}

Scheduler is capable of repeatedly measuring a given Target with a specific Sampler, and returns those results over channel C.

func (*Scheduler) Start

func (s *Scheduler) Start()

Start is meant to be called within a goroutine, and fires up the main event loop.

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Stop halts the event loop.

type StatusCodeError

type StatusCodeError struct {
	StatusCode int
}

StatusCodeError is an error representing an HTTP Status code of 400 or greater.

func (StatusCodeError) Error

func (e StatusCodeError) Error() string

type Target

type Target struct {
	URL  string
	Name string
}

Target represents the things that we are measureing.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

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