Batch statistics - check status of request?


I’m trying to use the batch statistics api requests.
It seems like the requests are being sent but sometimes nothing is being sent to the s3 bucket (sometimes yes).
Is there any way to follow the request? to check if is running or if it got stuck?

when I try to check with oauth.request it is on status “CREATED” for very long time, and I have no way to know if is working or not and if not, what is the reason.

# Get status information about a batch statistical request
response = oauth.request("GET", f"{request_id}/status")


{‘id’: ‘1234-request-id’,
‘status’: ‘CREATED’,
‘completionPercentage’: 0,
‘costPU’: 0.0,
‘created’: ‘2022-06-15T10:34:58.285972Z’}

my end goal is to be able to understand if the requests are running or something went wrong.

Hi @reutkeller ,

You are using the right code to check the status of your request.

Batch Statistical API is an async process and is not meant for immediate response (normal Stat API is there for that). Requests get in a queue, together with requests from other users, and are then scheduled based on the optimal scenario. This could be why sometimes your requests stayed on the status CREATED for long time.

I also recommend requesting analysis of your requests to see if there’s any errors.

Best Regards

1 Like

Thank you for your answer!

I have run laround 3 hours ago 3 requests from a loop.
I have print per request the analysis ans status is analyze but 0% proceed:

{'id': 'req1', 'status': 'ANALYSIS_DONE', 'completionPercentage': 0, 'costPU': 0.0, 'created': '2022-06-16T06:29:52.854932Z'}
{'id': 'req2', 'status': 'ANALYSIS_DONE', 'completionPercentage': 0, 'costPU': 0.0, 'created': '2022-06-16T06:29:53.294655Z'}
{'id': 'req', 'status': 'ANALYSIS_DONE', 'completionPercentage': 0, 'costPU': 0.0, 'created': '2022-06-16T06:29:53.781639Z'}

meanwhile, I can see result for one loop out of the 3 :confused:

This means that your requests are good to go. You can then request the start and wait for processing.

1 Like

Thanks ! apaprently I have missed the start part.
That solved the problem.