graphpaper

package
v0.0.0-...-6678ca1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2011 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = Configuration{[]ResolutionConfig{{"5m", 5 * 60 * 1000000000, 24 * 60 * 60 * 1000000000, "2006-01-02-15-04"}, {"1h", 60 * 60 * 1000000000, 24 * 60 * 60 * 1000000000, "2006-01-02"}}}
View Source
var Debug = false

Functions

func CollectdListener

func CollectdListener(c NodeMetricMeasurementChannel)

CollectdListener listens for data sent from collectd, parses it into CollectdMeasurements, and sends those measurements to the channel.

func DrawTable

func DrawTable(r io.Writer, t *DataTable, w uint, h uint) os.Error

func FileWriter

func FileWriter(c NodeMetricMeasurementChannel)

Filewriter recieves measurements from the channel and writes them to disk using a queue.

func FormatTime

func FormatTime(nanoSeconds int64, utc bool, format string) string

func FormatTimeLocal

func FormatTimeLocal(nanoSeconds int64) string

func NodeList

func NodeList(t int64) (r *[]Node, err os.Error)

func Watch

func Watch(dir string)

TODO: this doesn't check for any files that were written to before it starts up.

Types

type ColumnType

type ColumnType struct {
	StatisticalFunction statisticalFunction
	ValueType           valueType
}

type Configuration

type Configuration struct {
	Resolutions []ResolutionConfig
}

type DataTable

type DataTable struct {
	Start           int64
	End             int64
	Resolution      int64
	LineDefinitions []LineDefinition
	Values          []Value
}

func (*DataTable) Append

func (t *DataTable) Append(n *DataTable) (r *DataTable, err os.Error)

func (DataTable) Columnify

func (t DataTable) Columnify(i int) (r DataTable)

todo: maybe this should take a named index not a numeric one?

type File

type File struct {
	*os.File
	// contains filtered or unexported fields
}

func CreateFile

func CreateFile(path string, valueType valueType, startTime int64, resolution int64, functions int64) (file *File, err os.Error)

CreateAggFile will open the specified file, returning an error if the file exists

func CreateOrOpenFile

func CreateOrOpenFile(path string, valueType valueType, startTime int64, resolution int64, functions int64) (file *File, err os.Error)

func OpenFile

func OpenFile(path string) (file *File, err os.Error)

OpenAggFile will open the specified file, returning an error if the file does not exist.

func (File) Bytes

func (f File) Bytes() (header []byte)

func (*File) ColumnCount

func (f *File) ColumnCount() int64

func (File) Columns

func (f File) Columns() []ColumnType

func (File) IsRaw

func (h File) IsRaw() bool

func (*File) ReadAggregatedDataTable

func (r *File) ReadAggregatedDataTable(m Metric) (t DataTable, e os.Error)

func (*File) ReadAggregatedMeasurements

func (r *File) ReadAggregatedMeasurements() (s Summary, e os.Error)

func (*File) ReadMeasurements

func (r *File) ReadMeasurements() (Table, os.Error)

func (*File) ReadRawMeasurements

func (r *File) ReadRawMeasurements() (l *MeasurementList, e os.Error)

func (*File) TimeOffset

func (f *File) TimeOffset(time int64) int64

func (*File) WriteSummary

func (r *File) WriteSummary(s Summary) (err os.Error)

type LineDefinition

type LineDefinition struct {
	Node
	Property
	StatisticalFunction statisticalFunction
	ValueType           valueType
}

func (LineDefinition) Equals

func (d LineDefinition) Equals(n LineDefinition) bool

func (LineDefinition) String

func (d LineDefinition) String() string

type Measurement

type Measurement struct {
	Value    Value
	NanoTime int64
}

type MeasurementList

type MeasurementList []Measurement

func (MeasurementList) Columns

func (l MeasurementList) Columns() []ColumnType

func (MeasurementList) Data

func (l MeasurementList) Data() (d TimeSpliceSlice)

type Metric

type Metric struct {
	Node
	Property
}

func GetMetric

func GetMetric(n string, p string) (m Metric, err os.Error)

func (Metric) GetMeasurements

func (m Metric) GetMeasurements(start int64, end int64) (table *DataTable, err os.Error)

todo: this should accept some notion of resolution

type Node

type Node struct {
	Name string
}

func (Node) Metrics

func (n Node) Metrics(start int64, end int64) (l *[]Metric, err os.Error)

func (Node) String

func (n Node) String() string

type NodeMetricMeasurement

type NodeMetricMeasurement struct {
	Node   string // todo: should be a Node
	Metric string // todo: should be a Metric or Property
	Measurement
}

todo: better name please! todo: in the process of renaming, reconsider the interface between collectd and this queue

type NodeMetricMeasurementChannel

type NodeMetricMeasurementChannel chan NodeMetricMeasurement

type Property

type Property string

type ResolutionConfig

type ResolutionConfig struct {
	Name       string
	Resolution int64
	Size       int64
	DateFmt    string
}

type Summary

type Summary struct {
	ValueType  valueType
	Functions  int64
	Resolution int64
	Intervals  map[int64][]Value
}

a "summary" is a set of statistical functions applied to some measurements grouped by an interval

func Aggregate

func Aggregate(l *MeasurementList, interval int64, functions int64) (r Summary)

func (Summary) Bucketize

func (s Summary) Bucketize(capacity int64) (l map[int64]Summary)

func (Summary) Columns

func (s Summary) Columns() []ColumnType

func (Summary) Data

func (s Summary) Data() (d TimeSpliceSlice)

type Table

type Table interface {
	Data() TimeSpliceSlice
	Columns() []ColumnType
}

type TimeSplice

type TimeSplice struct {
	NanoTime int64
	Values   []Value
}

type TimeSpliceSlice

type TimeSpliceSlice []TimeSplice

func (TimeSpliceSlice) Len

func (s TimeSpliceSlice) Len() int

sort interface

func (TimeSpliceSlice) Less

func (s TimeSpliceSlice) Less(i, j int) bool

func (TimeSpliceSlice) Swap

func (s TimeSpliceSlice) Swap(i, j int)

type Value

type Value interface {
	Bytes() []byte
	Type() valueType
	Float64Value() float64Value
}

func ReadValue

func ReadValue(t valueType, f io.Reader) (v Value, err os.Error)

type ValueSlice

type ValueSlice []Value

func (ValueSlice) Len

func (s ValueSlice) Len() int

sort interface

func (ValueSlice) Less

func (s ValueSlice) Less(i, j int) bool

func (ValueSlice) Swap

func (s ValueSlice) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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