Documentation ¶
Index ¶
- Constants
- type ID
- type InfluxURL
- func (self InfluxURL) BatchPointsConfig() influxdb.BatchPointsConfig
- func (self InfluxURL) Connect() (influxdb.Client, error)
- func (self InfluxURL) Database() string
- func (self InfluxURL) Empty() bool
- func (self *InfluxURL) MarshalFlag() (string, error)
- func (self InfluxURL) Query(command string) influxdb.Query
- func (self InfluxURL) String() string
- func (self *InfluxURL) UnmarshalFlag(value string) error
- type Reader
- func (self *Reader) GetSeries(series SeriesKey, fields []string, duration time.Duration) (dataList []SeriesData, err error)
- func (self *Reader) GetStats(series SeriesKey, field string, duration time.Duration) (statsList []SeriesStats, err error)
- func (self *Reader) ListSeries(filter SeriesKey) (seriesList []SeriesKey, err error)
- func (self *Reader) ListTypes() (metas []SeriesMeta, err error)
- func (self *Reader) String() string
- type ReaderOptions
- type SeriesData
- type SeriesKey
- type SeriesMeta
- type SeriesPoint
- type SeriesStats
- type SeriesTab
- type Stats
- type Writer
- type WriterOptions
Constants ¶
const INFLUXDB_DATABASE = "close"
const INFLUXDB_PORT = "8086"
const INFLUXDB_USER_AGENT = "close-stats"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
StatsWriter identifier; this uniquely identifies an InfluxDB measurement series, which may include multiple fields
type InfluxURL ¶
func (InfluxURL) BatchPointsConfig ¶
func (self InfluxURL) BatchPointsConfig() influxdb.BatchPointsConfig
func (*InfluxURL) MarshalFlag ¶
func (*InfluxURL) UnmarshalFlag ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(options ReaderOptions) (*Reader, error)
func (*Reader) GetSeries ¶
func (self *Reader) GetSeries(series SeriesKey, fields []string, duration time.Duration) (dataList []SeriesData, err error)
Get full time-series data for given series's fields over given duration
func (*Reader) ListSeries ¶
func (*Reader) ListTypes ¶
func (self *Reader) ListTypes() (metas []SeriesMeta, err error)
type ReaderOptions ¶
type ReaderOptions struct {
InfluxURL InfluxURL `long:"influxdb-url" value-name:"http://[USER:[PASSWORD]@]HOST[:PORT]/DATABASE" env:"INFLUXDB_URL"`
}
func (ReaderOptions) Empty ¶
func (self ReaderOptions) Empty() bool
type SeriesData ¶
type SeriesData struct { SeriesKey Field string `json:"field"` Points []SeriesPoint `json:"points"` }
func (SeriesData) String ¶
func (self SeriesData) String() string
type SeriesKey ¶
type SeriesKey struct { Type string `json:"type"` Hostname string `json:"hostname,omitempty"` Instance string `json:"instance,omitempty"` }
Dynamic list of InfluxDB measurement-series. Each of these series may have multiple fields
type SeriesMeta ¶
Static list of InfluxDB measurements, and their fields
type SeriesPoint ¶
Temporal InfluxDB measurement-series-data
type SeriesStats ¶
func (SeriesStats) String ¶
func (self SeriesStats) String() string
type SeriesTab ¶
type SeriesTab struct { Time time.Time `json:"time"` Mean float64 `json:"mean"` Min float64 `json:"min"` Max float64 `json:"max"` Last float64 `json:"last"` }
Summarized InfluxDB measurement-series-data for table
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Wrap a statsd client to uniquely identify the measurements
func NewWriter ¶
func NewWriter(options WriterOptions) (*Writer, error)
func (*Writer) IntervalStatsWriter ¶
Return a channel which normally blocks on writes, but accepts a write every tick-interval XXX: this does not guarantee any minimum interval for the initial stats cycle, and is thus mostly broken..
func (*Writer) IntervalTick ¶
func (*Writer) StatsWriter ¶
Return a channel which continously accepts stats writes
type WriterOptions ¶
type WriterOptions struct { InfluxURL InfluxURL `long:"influxdb-url" value-name:"http://[USER:[PASSWORD]@]HOST[:PORT]/DATABASE" env:"INFLUXDB_URL"` Hostname string `long:"stats-hostname" env:"HOSTNAME"` Instance string `long:"stats-instance" env:"CLOSE_INSTANCE"` // Collection interval Interval time.Duration `long:"stats-interval" value-name:"SECONDS" default:"1s"` // Show stats on stdout Print bool `long:"stats-print"` }
func (WriterOptions) Empty ¶
func (self WriterOptions) Empty() bool