Documentation
¶
Index ¶
- Constants
- type AppLookup
- type Collector
- type MetricAggregator
- type MetricInserter
- type MetricPoint
- type ReqMetricsAggregator
- type ReqMetricsRollupManager
- type RequestMetricPoint
- type RequestMetricsInserter
- type RequestMetricsWriter
- type RollupManager
- type StatusApp
- type StatusSyncer
- type TierConfig
- type Writer
Constants ¶
const ( TierRaw = "raw" Tier1m = "1m" Tier5m = "5m" Tier1h = "1h" Tier1d = "1d" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppLookup ¶
AppLookup resolves an app slug to its database ID. Return (0, err) when the app is not found.
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector gathers system and container metrics.
func NewCollector ¶
func NewCollector(dc docker.Client, appLookup AppLookup, out chan<- MetricPoint) *Collector
NewCollector creates a new Collector. appLookup may be nil; if so, AppID will always be nil.
func (*Collector) CollectContainers ¶
func (c *Collector) CollectContainers(ctx context.Context) ([]MetricPoint, error)
CollectContainers collects metrics for all simpledeploy containers.
func (*Collector) CollectSystem ¶
func (c *Collector) CollectSystem() (MetricPoint, error)
CollectSystem collects host-level CPU, memory metrics.
func (*Collector) SetStatusSyncer ¶
func (c *Collector) SetStatusSyncer(ss StatusSyncer)
type MetricAggregator ¶
type MetricAggregator interface {
AggregateMetrics(sourceTier, destTier string, olderThan time.Time) error
PruneMetrics(tier string, before time.Time) (int64, error)
}
MetricAggregator is implemented by store.Store.
type MetricInserter ¶
type MetricInserter interface {
InsertMetrics(points []MetricPoint) error
}
MetricInserter is implemented by store.Store.
type MetricPoint ¶
type ReqMetricsAggregator ¶
type ReqMetricsAggregator interface {
AggregateRequestMetrics(sourceTier, destTier string, olderThan time.Time) error
PruneRequestMetrics(tier string, before time.Time) (int64, error)
}
ReqMetricsAggregator is implemented by store.Store.
type ReqMetricsRollupManager ¶
type ReqMetricsRollupManager struct {
// contains filtered or unexported fields
}
ReqMetricsRollupManager handles rollup and pruning for request metrics.
func NewReqMetricsRollupManager ¶
func NewReqMetricsRollupManager(st ReqMetricsAggregator, tiers []TierConfig) *ReqMetricsRollupManager
func (*ReqMetricsRollupManager) Run ¶
func (rm *ReqMetricsRollupManager) Run(ctx context.Context)
Run calls RunOnce every 60 seconds until ctx is cancelled.
func (*ReqMetricsRollupManager) RunOnce ¶
func (rm *ReqMetricsRollupManager) RunOnce() error
RunOnce performs one round of aggregation and pruning for request metrics.
type RequestMetricPoint ¶
type RequestMetricsInserter ¶
type RequestMetricsInserter interface {
InsertRequestMetrics(points []RequestMetricPoint) error
}
RequestMetricsInserter is implemented by store.Store.
type RequestMetricsWriter ¶
type RequestMetricsWriter struct {
// contains filtered or unexported fields
}
func NewRequestMetricsWriter ¶
func NewRequestMetricsWriter(st RequestMetricsInserter, in <-chan proxy.RequestStatEvent, appLookup func(string) (int64, error), bufSize int) *RequestMetricsWriter
type RollupManager ¶
type RollupManager struct {
// contains filtered or unexported fields
}
func NewRollupManager ¶
func NewRollupManager(st MetricAggregator, tiers []TierConfig) *RollupManager
func (*RollupManager) Run ¶
func (rm *RollupManager) Run(ctx context.Context)
Run calls RunOnce every 60 seconds until ctx is cancelled.
func (*RollupManager) RunOnce ¶
func (rm *RollupManager) RunOnce() error
RunOnce performs one round of aggregation and pruning.