github.com/influxdata/telegraf@v1.30.3/output.go (about)

     1  package telegraf
     2  
     3  type Output interface {
     4  	PluginDescriber
     5  
     6  	// Connect to the Output; connect is only called once when the plugin starts
     7  	Connect() error
     8  	// Close any connections to the Output. Close is called once when the output
     9  	// is shutting down. Close will not be called until all writes have finished,
    10  	// and Write() will not be called once Close() has been, so locking is not
    11  	// necessary.
    12  	Close() error
    13  	// Write takes in group of points to be written to the Output
    14  	Write(metrics []Metric) error
    15  }
    16  
    17  // AggregatingOutput adds aggregating functionality to an Output.  May be used
    18  // if the Output only accepts a fixed set of aggregations over a time period.
    19  // These functions may be called concurrently to the Write function.
    20  type AggregatingOutput interface {
    21  	Output
    22  
    23  	// Add the metric to the aggregator
    24  	Add(in Metric)
    25  	// Push returns the aggregated metrics and is called every flush interval.
    26  	Push() []Metric
    27  	// Reset signals that the aggregator period is completed.
    28  	Reset()
    29  }