Documentation ¶
Index ¶
- type TelemetryDatabase
- func (db *TelemetryDatabase) Close() error
- func (db *TelemetryDatabase) DeletePublishedOlderThan(ctx context.Context, duration time.Duration) error
- func (db *TelemetryDatabase) FetchMetrics(ctx context.Context, published bool, amount int) ([]telemetry.Metric, error)
- func (db *TelemetryDatabase) MarkAsPublished(ctx context.Context, rowids []int64) error
- func (db *TelemetryDatabase) StoreMetric(ctx context.Context, metric telemetry.Metric) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TelemetryDatabase ¶
type TelemetryDatabase struct {
// contains filtered or unexported fields
}
TelemetryDatabase implements the MetricStore interface and provides storage for a metric.
func New ¶
func New(dbURI string) (*TelemetryDatabase, error)
New returns a new TelemetryDatabase backed by database/sql.
func (*TelemetryDatabase) Close ¶
func (db *TelemetryDatabase) Close() error
Close closes the database.
func (*TelemetryDatabase) DeletePublishedOlderThan ¶
func (db *TelemetryDatabase) DeletePublishedOlderThan(ctx context.Context, duration time.Duration) error
DeletePublishedOlderThan deletes metrics other than provided duration.
func (*TelemetryDatabase) FetchMetrics ¶
func (db *TelemetryDatabase) FetchMetrics(ctx context.Context, published bool, amount int) ([]telemetry.Metric, error)
FetchMetrics fetches unplished metrics.
func (*TelemetryDatabase) MarkAsPublished ¶
func (db *TelemetryDatabase) MarkAsPublished(ctx context.Context, rowids []int64) error
MarkAsPublished marks metrics as published.
func (*TelemetryDatabase) StoreMetric ¶
StoreMetric persists a metric.
Directories ¶
Path | Synopsis |
---|---|
Package migrations generated by go-bindata.// sources: migrations/001_system_metrics.up.sql migrations/002_system_metrics.down.sql
|
Package migrations generated by go-bindata.// sources: migrations/001_system_metrics.up.sql migrations/002_system_metrics.down.sql |
Click to show internal directories.
Click to hide internal directories.