Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator reads PublishMetrics from a channel and distributes them to the configured Destinations.
func NewAggregator ¶
func NewAggregator(inputChannel chan PublishMetric, publishMetricDestinations, capabilityMetricDestinations []Destination, log *logger.UPPLogger) *Aggregator
NewAggregator returns an Aggregator which reads metrics from inputChannel and distributes them to destinations.
func (*Aggregator) Run ¶
func (a *Aggregator) Run()
Run reads PublishMetrics from a channel and distributes them to a list of Destinations. Stops reading when the channel is closed.
type Destination ¶
type Destination interface {
Send(pm PublishMetric)
}
Destination is the interface which defines a method to send PublishMetrics to a certain destination.
type GraphiteSender ¶ added in v1.1.0
type GraphiteSender struct {
// contains filtered or unexported fields
}
GraphiteSender implements Destination interface to send PublishMetrics for capability E2E tests to Graphite.
func NewGraphiteSender ¶ added in v1.1.0
func NewGraphiteSender(cfg *config.AppConfig, log *logger.UPPLogger) *GraphiteSender
NewGraphiteSender returns a GraphiteSender.
func (*GraphiteSender) Send ¶ added in v1.1.0
func (gs *GraphiteSender) Send(pm PublishMetric)
Send transforms a Publish metric to Graphite one and sends it to Graphite endpoint.
type History ¶
type History struct { PublishMetrics []PublishMetric // contains filtered or unexported fields }
func NewHistory ¶
func NewHistory(metrics []PublishMetric) *History
func (*History) First ¶
func (h *History) First() *PublishMetric
func (*History) GetFailures ¶
func (*History) Update ¶
func (h *History) Update(newPublishResult PublishMetric)
type Interval ¶
Interval is a simple representation of an interval of time, with a lower and upper boundary
type PublishMetric ¶
type PublishMetric struct { UUID string PublishOK bool //did it meet the SLA? PublishDate time.Time //the time WE get the message Platform string PublishInterval Interval //the interval it was actually published in, ex. (10,20) Config config.MetricConfig Endpoint url.URL TID string IsMarkedDeleted bool Capability *config.Capability }
PublishMetric holds the information about the metric we are measuring.
func (PublishMetric) String ¶
func (pm PublishMetric) String() string
type SplunkFeeder ¶
SplunkFeeder implements Destination interface to send PublishMetrics to Splunk. This is achieved by writing the metric into a file which is indexed by Splunk.
func NewSplunkFeeder ¶
func NewSplunkFeeder(logPrefix string) *SplunkFeeder
NewSplunkFeeder returns a SplunkFeeder which will write the PublishMetrics to the file at filePath. If the file exists, it will be appended to.