get_job_metrics_for_workflow
Retrieve job execution metrics for a specific workflow, providing targeted insights into performance and execution statistics.
Instructions
Get the job metrics for the specified workflow from Workflow Engine.
Retrieves job execution metrics filtered by a specific workflow name, providing targeted insights into the performance and execution statistics for jobs within that particular workflow.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the workflow to get the job metrics for |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | Response model for job metrics collection endpoints. This Pydantic RootModel provides a standardized response format for API endpoints that return collections of job metrics from the Itential Platform workflow engine. It wraps a list of JobMetricElement objects, enabling type-safe handling of job metrics data across the platform. The root model pattern allows the response to be treated as a list while maintaining proper validation and serialization capabilities for the contained job metric elements. Args: root: List of JobMetricElement objects containing job performance data. Defaults to an empty list if not provided. Attributes: root (List[JobMetricElement]): Collection of job metric elements with performance and completion statistics for workflow monitoring Example: Creating a response with multiple job metrics: >>> job1 = JobMetricElement(_id="job1", workflow="wf1", metrics=[], ... jobsComplete=10, totalRunTime=100.0) >>> job2 = JobMetricElement(_id="job2", workflow="wf2", metrics=[], ... jobsComplete=20, totalRunTime=250.5) >>> response = GetJobMetricsResponse([job1, job2]) >>> print(len(response.root)) # 2 >>> print(response.root[0].jobs_complete) # 10 Notes: - Uses default_factory=list to create empty collections when needed - Supports iteration and indexing through the root attribute - Maintains type safety for all contained JobMetricElement objects |