Skip to main content

windmill_api/models/
worker_ping_job_stats.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.864.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// WorkerPingJobStats : script and flow-step jobs this worker ran and how many of them failed, over its whole life, the last 24 hours and its last 100 jobs. A flow's own outcome is not counted, since its failure is that of a step already counted on the worker that ran it. Canceled jobs count as executed, not failed.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WorkerPingJobStats {
17    #[serde(rename = "total")]
18    pub total: Box<models::WorkerJobCounts>,
19    #[serde(rename = "last_24h")]
20    pub last_24h: Box<models::WorkerJobCounts>,
21    #[serde(rename = "last_100")]
22    pub last_100: Box<models::WorkerJobCounts>,
23}
24
25impl WorkerPingJobStats {
26    /// script and flow-step jobs this worker ran and how many of them failed, over its whole life, the last 24 hours and its last 100 jobs. A flow's own outcome is not counted, since its failure is that of a step already counted on the worker that ran it. Canceled jobs count as executed, not failed.
27    pub fn new(total: models::WorkerJobCounts, last_24h: models::WorkerJobCounts, last_100: models::WorkerJobCounts) -> WorkerPingJobStats {
28        WorkerPingJobStats {
29            total: Box::new(total),
30            last_24h: Box::new(last_24h),
31            last_100: Box::new(last_100),
32        }
33    }
34}
35