REST API - Task Stats

iceprod.rest.handlers.task_stats.setup(handler_cfg)[source]

Setup method for Task Stats REST API.

Parameters:

handler_cfg (dict) – args to pass to the route

Returns:

routes, database, indexes

Return type:

dict

class iceprod.rest.handlers.task_stats.MultiTaskStatsHandler(*args, **kwargs)[source]

Handle multi task_stats requests.

async post(task_id)[source]

Create a task_stat entry.

Body should contain the task stat data.

Parameters:

task_id (str) – the task id for this task_stat

Returns:

{‘result’: <task_stat_id>}

Return type:

dict

class iceprod.rest.handlers.task_stats.DatasetsBulkTaskStatsHandler(*args, **kwargs)[source]

Handle a dataset bulk task_stats requests.

Stream the output of all stats.

async get(dataset_id)[source]

Get task_stats for a dataset and task.

Parameters:

dataset_id (str) – dataset id

Params (optional):

last: bool (True: only last task_stat. False: all task_stats) after: only return stats created more recently than this date keys: | separated list of keys to return for each task_stat buffer_size: number of records to buffer before flushing (default 100)

Returns:

{<task_stat_id>: stats}

Return type:

dict

class iceprod.rest.handlers.task_stats.DatasetsMultiTaskStatsHandler(*args, **kwargs)[source]

Handle multi task_stats requests.

async get(dataset_id, task_id)[source]

Get task_stats for a dataset and task.

Parameters:
  • dataset_id (str) – dataset id

  • task_id (str) – task id

Params (optional):

last: bool (True: only last task_stat. False: all task_stats) keys: | separated list of keys to return for each task_stat

Returns:

{<task_stat_id>: stats}

Return type:

dict

class iceprod.rest.handlers.task_stats.DatasetsTaskStatsHandler(*args, **kwargs)[source]

Handle single task_stat requests.

async get(dataset_id, task_id, task_stat_id)[source]

Get a task_stat entry.

Parameters:
  • dataset_id (str) – dataset id

  • task_id (str) – task id

  • task_stat_id (str) – the task_stat id

Returns:

task_stat entry

Return type:

dict