2015-05-29 19:50:05 +00:00
|
|
|
package continuous_querier
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/influxdb/influxdb/toml"
|
|
|
|
)
|
|
|
|
|
2015-11-22 19:23:56 +00:00
|
|
|
// Default values for aspects of interval computation.
|
2015-05-29 19:50:05 +00:00
|
|
|
const (
|
2015-12-18 20:32:05 +00:00
|
|
|
DefaultRunInterval = time.Second
|
2015-05-29 19:50:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Config represents a configuration for the continuous query service.
|
|
|
|
type Config struct {
|
2015-07-22 01:02:04 +00:00
|
|
|
// Enables logging in CQ service to display when CQ's are processed and how many points are wrote.
|
|
|
|
LogEnabled bool `toml:"log-enabled"`
|
|
|
|
|
2015-05-29 19:50:05 +00:00
|
|
|
// If this flag is set to false, both the brokers and data nodes should ignore any CQ processing.
|
|
|
|
Enabled bool `toml:"enabled"`
|
|
|
|
|
2015-12-18 20:32:05 +00:00
|
|
|
// Run interval for checking continuous queries. This should be set to the least common factor
|
|
|
|
// of the interval for running continuous queries. If you only aggregate continuous queries
|
|
|
|
// every minute, this should be set to 1 minute. The default is set to '1s' so the interval
|
|
|
|
// is compatible with most aggregations.
|
|
|
|
RunInterval toml.Duration `toml:"run-interval"`
|
2015-05-29 19:50:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewConfig returns a new instance of Config with defaults.
|
|
|
|
func NewConfig() Config {
|
|
|
|
return Config{
|
2015-12-18 20:32:05 +00:00
|
|
|
LogEnabled: true,
|
|
|
|
Enabled: true,
|
|
|
|
RunInterval: toml.Duration(DefaultRunInterval),
|
2015-05-29 19:50:05 +00:00
|
|
|
}
|
|
|
|
}
|