1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Windmill API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.831.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,
}
}
}