flowserv.model.ranking module
This module contains the ranking manager that is responsible for maintaining and querying analytics results for individual workflows.
- class flowserv.model.ranking.RankingManager(session)
Bases:
objectThe ranking manager maintains leader boards for individual workflows. Analytics results for each workflow are maintaind in separate tables. The schema of thoses tables is defined by the result schema of the respective workflow template.
- get_ranking(workflow, order_by=None, include_all=False)
Query the underlying database to retrieve a result ranking for a given workflow.
- Parameters
workflow (flowserv.model.base.WorkflowObject) – Handle for workflow.
order_by (list(flowserv.model.template.schema.SortColumn), optional) – Use the given attribute to sort run results. If not given, the schema default sort order is used
include_all (bool, optional) – Include at most one entry per group in the result if False
- Return type
- class flowserv.model.ranking.RunResult(run_id, group_id, group_name, created_at, started_at, finished_at, values)
Bases:
objectHandle for analytics results of a successful workflow run. Maintains the run identifier, run timestamps, group information, and a dictionary containing the generated values. The elements in the dictionary are defined by the result schema in the respective workflow template.
- exectime()
The execution time for the workflow run is the difference between the start timestamp and the end timestamp.
- Return type
datetime.timedelta
- get(name)
Get the result value for the schema attribute with the given name.
- Parameters
name (string) – Name of attribute in the result schema.
- Return type
string, int, or float