MCPcopy Create free account
hub / github.com/TalkingData/owl / queryTimeSeriesData

Function queryTimeSeriesData

api/data.go:27–42  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

25}
26
27func queryTimeSeriesData(c *gin.Context) {
28 metric := c.Query("metric")
29 tags := c.Query("tags")
30 start := c.DefaultQuery("start", time.Now().Add(-time.Hour).Format("2006/01/02-15:04:05"))
31 end := c.DefaultQuery("end", time.Now().Format("2006/01/02-15:04:05"))
32 response := gin.H{}
33 defer c.JSON(http.StatusOK, response)
34 result, err := tsdbClient.Query(start, end, tags, "sum", metric, false)
35 if err != nil {
36 response["message"] = err.Error()
37 response["code"] = http.StatusInternalServerError
38 return
39 }
40 response["data"] = result
41 response["code"] = http.StatusOK
42}

Callers

nothing calls this directly

Calls 2

QueryMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected