func (a *Agent) flush() {
	var wg sync.WaitGroup

	wg.Add(len(a.Config.Outputs))
	for _, o := range a.Config.Outputs {
		go func(output *models.RunningOutput) {
			defer wg.Done()
			err := output.Write()
			if err != nil {
				log.Printf("E! Error writing to output [%s]: %s\n",
					output.Name, err.Error())
			}
		}(o)
	}

	wg.Wait()
}
// flush writes a list of metrics to all configured outputs
flush writes a list of metrics to all configured outputs
// flush writes a list of metrics to all configured outputs
func (a *Agent) flush() {
	var wg sync.WaitGroup
	wg.Add(len(a.Config.Outputs))
	for _, o := range a.Config.Outputs {
		go func(output *models.RunningOutput) {
			defer wg.Done()
			err := output.Write()
			if err != nil {
				log.Printf("E! Error writing to output [%s]: %s\n",
					output.Name, err.Error())
			}
		}(o)
	}
	wg.Wait()
}
func ( a * Agent ) flush ( ) { var wg sync . WaitGroup wg . Add ( len ( a . Config . Outputs ) ) for _ , o := range a . Config . Outputs { go func ( output * models . RunningOutput ) { defer wg . Done ( ) err := output . Write ( ) if err != nil { log . Printf ( " \n " , output . Name , err . Error ( ) ) } } ( o ) } wg . Wait ( ) }
flush writes a list of metrics to all configured outputs
flush writes a list of metrics to all configured outputs