influxdata / Litmus

testing framework
0 stars 0 forks source link

Quartz's query: query_billing total duration of the query #193

Closed gshif closed 5 years ago

gshif commented 5 years ago

test quartz's query (defined in https://github.com/influxdata/quartz/blob/cloud-two-dev/lib/quartz/two/billing/organization_usage.ex):

 def get_query_duration(org_id, start, stop) do
    """
    from(bucket: "system_usage")
    |> range(start: #{start}, stop: #{stop})
    |> filter(fn: (r) =>
    r.org_id != ""
    and r.org_id == "#{org_id}"
    and r._measurement == "queryd_billing"
    and r._field == "total_duration_us"
    )
    |> group()
    |> aggregateWindow(every: 1h, fn: sum)
    |> keep(columns: ["_time", "_value", "_start"])
    |> fill(column: "_value", value: 0)
    |> rename(columns: {_value: "duration_us"})
    |> yield(name: "duration_us")
    """
  end
gshif commented 5 years ago
gshif commented 5 years ago

Based on the code and conversation with Balaji, query duration will be reported all the time whether query was successful or failed.