Stéphan Taljaard
02/04/2022, 6:16 AMAnna Geller
02/04/2022, 10:33 AMquery {
task_run_state_aggregate(where: {
timestamp: { _gte: "2022-02-04T00:00:00.000000+00:00" }
state: { _in: ["Success"] }
}) {
aggregate {
count
}
}
}
But this would give you all tasks incl. those that take less than 1 sec. For billing, we exclude those, so to get more realistic number you would need to add start and end time to the query and calculate the duration in a Python script and then take out those that take less than a second.
In Cloud we are not billing for:
• failed task runs
• task runs that took less than a second
• retries{
billing_usage(order_by: {timestamp: desc}) {
runs
timestamp
}
}
Stéphan Taljaard
02/04/2022, 11:25 AM{
"errors": [
{
"message": "Cannot query field \"billing_usage\" on type \"Query\".",
"locations": [
{
"line": 2,
"column": 3
}
],
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED"
}
}
]
}