Kaynağa Gözat

Merge remote-tracking branch 'pteichman/graphite-once'

Richard Crowley 11 yıl önce
ebeveyn
işleme
92059232d3
1 değiştirilmiş dosya ile 7 ekleme ve 0 silme
  1. 7 0
      graphite.go

+ 7 - 0
graphite.go

@@ -45,6 +45,13 @@ func GraphiteWithConfig(c GraphiteConfig) {
 	}
 }
 
+// GraphiteOnce performs a single submission to Graphite, returning a
+// non-nil error on failed connections. This can be used in a loop
+// similar to GraphiteWithConfig for custom error handling.
+func GraphiteOnce(c GraphiteConfig) error {
+	return graphite(&c)
+}
+
 func graphite(c *GraphiteConfig) error {
 	now := time.Now().Unix()
 	du := float64(c.DurationUnit)