windmill-api 1.834.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.834.0
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// RunnableStats : Resource usage of the jobs of one runnable on one worker group. Memory and CPU are only known for jobs run as a subprocess; memory is the peak of the job's main process. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RunnableStats {
    #[serde(rename = "workspace_id")]
    pub workspace_id: String,
    /// path of the script or flow step; `<adhoc>` gathers previews and other runs without a stable path
    #[serde(rename = "runnable_path")]
    pub runnable_path: String,
    #[serde(rename = "worker_group")]
    pub worker_group: String,
    #[serde(rename = "job_count")]
    pub job_count: i32,
    #[serde(rename = "total_duration_ms")]
    pub total_duration_ms: i32,
    /// highest peak memory of a job, in kB
    #[serde(rename = "max_memory_peak")]
    pub max_memory_peak: i32,
    /// sum of the peak memory of the jobs that have one, in kB
    #[serde(rename = "sum_memory_peak")]
    pub sum_memory_peak: i32,
    /// number of jobs that have a peak memory reading
    #[serde(rename = "memory_sample_count")]
    pub memory_sample_count: i32,
    #[serde(rename = "total_cpu_ms")]
    pub total_cpu_ms: i32,
}

impl RunnableStats {
    /// Resource usage of the jobs of one runnable on one worker group. Memory and CPU are only known for jobs run as a subprocess; memory is the peak of the job's main process. 
    pub fn new(workspace_id: String, runnable_path: String, worker_group: String, job_count: i32, total_duration_ms: i32, max_memory_peak: i32, sum_memory_peak: i32, memory_sample_count: i32, total_cpu_ms: i32) -> RunnableStats {
        RunnableStats {
            workspace_id,
            runnable_path,
            worker_group,
            job_count,
            total_duration_ms,
            max_memory_peak,
            sum_memory_peak,
            memory_sample_count,
            total_cpu_ms,
        }
    }
}