circonus-gometrics.go
func (m *CirconusMetrics) Flush() {
	m.flushmu.Lock()
	if m.flushing {
		m.flushmu.Unlock()
		return
	}

	m.flushing = true
	m.flushmu.Unlock()

	newMetrics, output := m.packageMetrics()

	if len(output) > 0 {
		m.submit(output, newMetrics)
	} else {
		if m.Debug {
			m.Log.Println("[DEBUG] No metrics to send, skipping")
		}
	}

	m.flushmu.Lock()
	m.flushing = false
	m.flushmu.Unlock()
}
func (m *CirconusMetrics) Flush() {
	m.flushmu.Lock()
	if m.flushing {
		m.flushmu.Unlock()
		return
	}

	m.flushing = true
	m.flushmu.Unlock()

	newMetrics, output := m.packageMetrics()

	if len(output) > 0 {
		m.submit(output, newMetrics)
	} else {
		if m.Debug {
			m.Log.Println("[DEBUG] No metrics to send, skipping")
		}
	}

	m.flushmu.Lock()
	m.flushing = false
	m.flushmu.Unlock()
}
func ( m * CirconusMetrics ) Flush ( ) { m . flushmu . Lock ( ) if m . flushing { m . flushmu . Unlock ( ) return } m . flushing = true m . flushmu . Unlock ( ) newMetrics , output := m . packageMetrics ( ) if len ( output ) > 0 { m . submit ( output , newMetrics ) } else { if m . Debug { m . Log . Println ( " " ) } } m . flushmu . Lock ( ) m . flushing = false m . flushmu . Unlock ( ) }
// Flush metrics kicks off the process of sending metrics to Circonus
Flush metrics kicks off the process of sending metrics to Circonus