| 1171 | } |
| 1172 | |
| 1173 | func (h *httpAPI) QueryRange(ctx context.Context, query string, r Range, opts ...Option) (model.Value, Warnings, error) { |
| 1174 | u := h.client.URL(epQueryRange, nil) |
| 1175 | q := addOptionalURLParams(u.Query(), opts) |
| 1176 | |
| 1177 | q.Set("query", query) |
| 1178 | q.Set("start", formatTime(r.Start)) |
| 1179 | q.Set("end", formatTime(r.End)) |
| 1180 | q.Set("step", strconv.FormatFloat(r.Step.Seconds(), 'f', -1, 64)) |
| 1181 | |
| 1182 | _, body, warnings, err := h.client.DoGetFallback(ctx, u, q) |
| 1183 | if err != nil { |
| 1184 | return nil, warnings, err |
| 1185 | } |
| 1186 | |
| 1187 | var qres queryResult |
| 1188 | return qres.v, warnings, json.Unmarshal(body, &qres) |
| 1189 | } |
| 1190 | |
| 1191 | func (h *httpAPI) Series(ctx context.Context, matches []string, startTime, endTime time.Time, opts ...Option) ([]model.LabelSet, Warnings, error) { |
| 1192 | u := h.client.URL(epSeries, nil) |