gnmsys

package
v0.0.0-...-6c81395 Latest Latest
Warning

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

Go to latest
Published: May 15, 2015 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSystem

func CreateSystem(config SysConfig, reportFactories ...ReportFactory) defaultSystem

Types

type CliListener

type CliListener struct {
	Sys System
}

func (CliListener) Start

func (l CliListener) Start()

type Collector

type Collector interface {
	Name() string
	AddSample(time int64, metrics Json)
	AddXYSample(x, y float64)
	GetXYs() plotter.XYs
}

type CollectorFactory

type CollectorFactory func(capacity int) Collector

func NewFloatCollector

func NewFloatCollector(name string, jsonPath ...string) CollectorFactory

type FloatCollector

type FloatCollector struct {
	// contains filtered or unexported fields
}

func (*FloatCollector) AddSample

func (c *FloatCollector) AddSample(time int64, metrics Json)

func (*FloatCollector) AddXYSample

func (c *FloatCollector) AddXYSample(x, y float64)

func (FloatCollector) GetXYs

func (c FloatCollector) GetXYs() plotter.XYs

func (FloatCollector) Name

func (c FloatCollector) Name() string

type Json

type Json struct {
	Data map[string]interface{}
}

func (Json) Float

func (obj Json) Float(key string) float64

func (Json) Obj

func (obj Json) Obj(key string) Json

func (Json) String

func (obj Json) String(key string) string

type LineGraphReport

type LineGraphReport struct {
	// contains filtered or unexported fields
}

func NewLineGraphReport

func NewLineGraphReport(name string,
	report PlotFactory,
	width, height vg.Length,
	sampleConfig SampleConfig,
	collectors ...Collector) LineGraphReport

func (LineGraphReport) GetCategory

func (r LineGraphReport) GetCategory() string

func (LineGraphReport) GetFileName

func (r LineGraphReport) GetFileName() string

func (LineGraphReport) GetName

func (r LineGraphReport) GetName() string

func (LineGraphReport) GetUpdateInterval

func (r LineGraphReport) GetUpdateInterval() time.Duration

func (LineGraphReport) Load

func (r LineGraphReport) Load(reportDir string)

func (LineGraphReport) Save

func (r LineGraphReport) Save(titleModifier string, reportDir string)

func (LineGraphReport) Update

func (r LineGraphReport) Update(timeSeconds int64, metrics Json)

type LineReportFactoryBuilder

type LineReportFactoryBuilder struct {
	Title, YAxis, Filename string
	X, Y                   vg.Length
	CollectorFactories     []CollectorFactory
}

func (LineReportFactoryBuilder) ToRequestFactory

func (b LineReportFactoryBuilder) ToRequestFactory() ReportFactory

type PlotFactory

type PlotFactory func() *plot.Plot

type Report

type Report interface {
	GetCategory() string
	GetName() string
	GetFileName() string
	GetUpdateInterval() time.Duration
	Update(timeSeconds int64, metrics Json)
	Save(titleModifier string, reportDir string)
	Load(reportDir string)
}

type ReportFactory

type ReportFactory func(sampleConfig SampleConfig) Report

type SampleConfig

type SampleConfig struct {
	Name, DirName, XAxis string
	MaxSamples           int
	UpdateInterval       time.Duration
}

func (SampleConfig) Unit

func (conf SampleConfig) Unit() unit.Unit

func (SampleConfig) Validate

func (conf SampleConfig) Validate()

type SysConfig

type SysConfig struct {
	UrlStem,
	Username,
	Password,
	OutputDir string
	SampleConfigs []SampleConfig
}

type System

type System interface {
	// function that will signal to the system to clean up and shutdown
	SignalTerm()
	// function that will write the reports to disk
	SignalFlush()
	// List all the Reports available
	GetReports() []Report
	// Get the output file of the report
	GetReportFile(report Report) string
}

type SystemSignal

type SystemSignal int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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