Got a question about the GQL query tool: How difficult would it be to query the execution time of all task instances in a given flow with a given identifier?
k
Kevin Kho
05/19/2021, 8:05 PM
Hi @kevin, you can’t entire do this in graphQL. You’d need to use graphQL then bring it in to processing in Python with something like this:
runs = client.graphql(query, variables=dict(flowId="<<flow_id>>"))
task_runs = []
for run in runs["data"]:
task_runs.append({ "id": run["id"], "duration": run["end_time"] - run["start_time"] })
# now you can do stuff with those durations
avg_duration = sum(r["duration"] for r in task_runs) / len(task_runs)
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.