canary: Index | Files

package sensor

import ""


Package Files


type Measurement Uses

type Measurement struct {
    Target     sampler.Target
    Sample     sampler.Sample
    IsOK       bool
    StateCount int
    Error      error

Measurement reprents an aggregate of Target, Sample and error.

type Sensor Uses

type Sensor struct {
    Target         sampler.Target
    C              chan Measurement
    StateCounter   int
    StopChan       chan int
    IsStopped      bool
    StopNotifyChan chan bool
    IsOK           bool
    Timeout        int // timeout in secs

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

func (*Sensor) Start Uses

func (s *Sensor) Start(delay float64)

Start is meant to be called within a goroutine, and fires up the main event loop. interval is number of seconds. delay is number of ms.

func (*Sensor) Stop Uses

func (s *Sensor) Stop()

Stop halts the event loop.

Package sensor imports 2 packages (graph) and is imported by 3 packages. Updated 2016-08-01. Refresh now. Tools for package owners.