Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultPoopTime() (start string, end string)
- func Execute()
- func SetupLogger()
- func ToEsTimestamp(t time.Time) int64
- type Config
- type ElasticSearch
- type EsError
- type EsResponse
- type GulpConf
- type Influx
- type Iterator
- type Point
- type PoopConf
- type RegurgitateConf
- type RuminateConf
- type Sampler
- type SamplerConfig
Constants ¶
View Source
const LatestIndicator = "RUMINANT_LAST_RUN"
Variables ¶
View Source
var RootCmd = &cobra.Command{
Use: "ruminant",
Short: "Feed data from ElasticSearch to InfluxDB",
}
Functions ¶
func DefaultPoopTime ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func SetupLogger ¶
func SetupLogger()
func ToEsTimestamp ¶
Types ¶
type Config ¶
type Config struct { Regurgitate RegurgitateConf `yaml:"regurgitate"` Ruminate RuminateConf `yaml:"ruminate"` Gulp GulpConf `yaml:"gulp"` Poop PoopConf `yaml:"poop"` }
type ElasticSearch ¶
func NewElasticSearch ¶
func NewElasticSearch(proto, host string, port int) ElasticSearch
func (ElasticSearch) Query ¶
func (es ElasticSearch) Query(index, kind, jsonQuery string) (EsResponse, error)
type EsError ¶
type EsError struct { Error struct { RootCause []struct { Type string `json:"type"` Reason string `json:"reason"` Line int `json:"line"` Col int `json:"col"` } `json:"root_cause"` Type string `json:"type"` Reason string `json:"reason"` Line int `json:"line"` Col int `json:"col"` } `json:"error"` Status int `json:"status"` }
type EsResponse ¶
type EsResponse struct { Took float64 `json:"took"` TimedOut bool `json:"timed_out"` Shards struct { Total float64 `json:"total"` Success float64 `json:"success"` Failed float64 `json:"failed"` } `json:"_shards"` Hits struct { Total float64 `json:"total"` MaxScore float64 `json:"max_score"` Hits interface{} `json:"hits"` } `json:"hits"` Aggregations interface{} `json:"aggregations"` Error string `json:"error"` }
func NewEsResponse ¶
func NewEsResponse(in io.Reader) (EsResponse, error)
func (EsResponse) AggsAsJson ¶
func (esr EsResponse) AggsAsJson() ([]byte, error)
type Iterator ¶
type Iterator struct { Selector string `yaml:"selector"` Time string `yaml:"time"` Tags map[string]string `yaml:"tags"` FixedTags map[string]string `yaml:"fixed_tags"` Values map[string]string `yaml:"values"` FixedValues map[string]string `yaml:"fixed_values"` Iterators []Iterator `yaml:"iterators"` }
func (Iterator) GetStructure ¶
type RegurgitateConf ¶
type RuminateConf ¶
type RuminateConf struct {
Iterator Iterator `yaml:"iterator"`
}
type Sampler ¶
type Sampler struct {
// contains filtered or unexported fields
}
func NewSampler ¶
func NewSampler(c SamplerConfig) (Sampler, error)
func (Sampler) BuildQueries ¶
Click to show internal directories.
Click to hide internal directories.