summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hub/Makefile6
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5srv.go2
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5srvForwardGraphite.go12
3 files changed, 12 insertions, 8 deletions
diff --git a/src/hub/Makefile b/src/hub/Makefile
index cd29c1c..939f265 100644
--- a/src/hub/Makefile
+++ b/src/hub/Makefile
@@ -60,10 +60,14 @@ updatelibs: update-rhrd-go
vet:
@echo "vetting: $(EXECUTEABLE)"
@$(GOCMD) vet spreadspace.org/$(EXECUTEABLE)
+ @echo "vetting: sfive"
+ @$(GOCMD) vet spreadspace.org/sfive
format:
@echo "formatting: $(EXECUTEABLE)"
- $(GOCMD) fmt spreadspace.org/$(EXECUTEABLE)
+ @$(GOCMD) fmt spreadspace.org/$(EXECUTEABLE)
+ @echo "formatting: sfive"
+ @$(GOCMD) fmt spreadspace.org/sfive
build: getlibs
@echo "installing: $(EXECUTEABLE)"
diff --git a/src/hub/src/spreadspace.org/sfive/s5srv.go b/src/hub/src/spreadspace.org/sfive/s5srv.go
index dace0a5..1946414 100644
--- a/src/hub/src/spreadspace.org/sfive/s5srv.go
+++ b/src/hub/src/spreadspace.org/sfive/s5srv.go
@@ -104,7 +104,7 @@ func (self StatsSinkServer) appendActor() {
token.response <- getHubIdResult{storeId, err}
case token := <-self.getLastUpdateIdChan:
lastUpdateId, err := self.store.GetLastUpdateId()
- if(lastUpdateId != nil) {
+ if lastUpdateId != nil {
token.response <- getLastUpdateIdResult{*lastUpdateId, err}
} else {
token.response <- getLastUpdateIdResult{0, err}
diff --git a/src/hub/src/spreadspace.org/sfive/s5srvForwardGraphite.go b/src/hub/src/spreadspace.org/sfive/s5srvForwardGraphite.go
index 802be3c..9779960 100644
--- a/src/hub/src/spreadspace.org/sfive/s5srvForwardGraphite.go
+++ b/src/hub/src/spreadspace.org/sfive/s5srvForwardGraphite.go
@@ -1,8 +1,8 @@
package sfive
import (
- "time"
"fmt"
+ "time"
"github.com/equinox0815/graphite-golang"
)
@@ -20,7 +20,7 @@ func (self StatsSinkServer) getLastUpdateGraphite(conn *graphite.Graphite) (late
func (self StatsSinkServer) handleForwardingToGraphite(forwardHost string, basePath string) {
tryResync:
for {
- client, err := graphite.NewGraphiteFromAddress(forwardHost);
+ client, err := graphite.NewGraphiteFromAddress(forwardHost)
if err != nil {
s5l.Printf("fwd-graphite: connect returned err: %v", err)
time.Sleep(5 * time.Second)
@@ -52,7 +52,7 @@ tryResync:
continue nextBatch
}
- metrics := make([]graphite.Metric, len(updates) * 3)
+ metrics := make([]graphite.Metric, len(updates)*3)
for i, update := range updates {
path := basePath + "." + update.Hostname
@@ -60,9 +60,9 @@ tryResync:
path = path + "." + update.StreamId.Format
path = path + "." + update.StreamId.Quality
- metrics[i*3] = graphite.NewMetric(path + ".client-count", fmt.Sprintf("%d", update.Data.ClientCount), update.StartTime.Unix())
- metrics[i*3 + 1] = graphite.NewMetric(path + ".bytes-received", fmt.Sprintf("%d", update.Data.BytesReceived), update.StartTime.Unix())
- metrics[i*3 + 2] = graphite.NewMetric(path + ".bytes-sent", fmt.Sprintf("%d", update.Data.BytesSent), update.StartTime.Unix())
+ metrics[i*3] = graphite.NewMetric(path+".client-count", fmt.Sprintf("%d", update.Data.ClientCount), update.StartTime.Unix())
+ metrics[i*3+1] = graphite.NewMetric(path+".bytes-received", fmt.Sprintf("%d", update.Data.BytesReceived), update.StartTime.Unix())
+ metrics[i*3+2] = graphite.NewMetric(path+".bytes-sent", fmt.Sprintf("%d", update.Data.BytesSent), update.StartTime.Unix())
}
err = client.SendMetrics(metrics)