Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 368 Bytes

QUERY.md

File metadata and controls

20 lines (14 loc) · 368 Bytes

Queries

Build basic query

n := time.Now()
d := time.Hour

c := w.NewClient("https://warp10.gra1.metrics.ovh.net")
c.ReadToken = "READ_TOKEN"

q := c.NewQuery()
q = q.Fetch("", "os.cpu", w.Labels{}, n, d)
q = q.Bucketize(w.BucketizerSum, n, 5*time.Second, 0)
q = q.Map(w.MapperRate, "", 1, 0, 0)
q = q.Reduce(w.RSum, []string{})

result, err := q.Exec()