Skip to content

Commit

Permalink
Merge pull request #2282 from tcolgate/master
Browse files Browse the repository at this point in the history
OpenTSDB Input - use "value" as the field name
  • Loading branch information
otoolep committed Apr 14, 2015
2 parents 1da5bc3 + 4b3345c commit 53c0313
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cmd/influxd/server_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@ func Test_ServerOpenTSDBIntegration(t *testing.T) {
return
}

expected := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","cpu"],"values":[["%s",10]]}]}]}`, now.Format(time.RFC3339Nano))
expected := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["%s",10]]}]}]}`, now.Format(time.RFC3339Nano))

// query and wait for results
got, ok := queryAndWait(t, nodes, "opentsdb", `select * from "opentsdb"."raw".cpu`, expected, "", 2*time.Second)
Expand Down Expand Up @@ -1855,7 +1855,7 @@ func Test_ServerOpenTSDBIntegration_WithTags(t *testing.T) {
return
}

expected := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","cpu"],"values":[["%s",20]]}]}]}`, now.Format(time.RFC3339Nano))
expected := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["%s",20]]}]}]}`, now.Format(time.RFC3339Nano))

// query and wait for results
got, ok := queryAndWait(t, nodes, "opentsdb", `select * from "opentsdb"."raw".cpu where tag1='val3'`, expected, "", 2*time.Second)
Expand Down Expand Up @@ -1907,7 +1907,7 @@ func Test_ServerOpenTSDBIntegration_BadData(t *testing.T) {
return
}

expected := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","cpu"],"values":[["%s",10]]}]}]}`, now.Format(time.RFC3339Nano))
expected := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["%s",10]]}]}]}`, now.Format(time.RFC3339Nano))

// query and wait for results
got, ok := queryAndWait(t, nodes, "opentsdb", `select * from "opentsdb"."raw".cpu`, expected, "", 2*time.Second)
Expand Down
2 changes: 1 addition & 1 deletion opentsdb/opentsdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (s *Server) HandleConnection(conn net.Conn) {
}

fields := make(map[string]interface{})
fields[name], err = strconv.ParseFloat(valueStr, 64)
fields["value"], err = strconv.ParseFloat(valueStr, 64)
if err != nil {
log.Println("TSDBServer: could not parse value as float: ", valueStr)
continue
Expand Down

0 comments on commit 53c0313

Please sign in to comment.