Skip to main content

hanzo_client/models/
sample_view.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SampleView {
16    /// At is when the reading was MEASURED, RFC 3339 in UTC — the x-axis a chart plots against. The series is returned oldest first, so it only increases.
17    #[serde(rename = "at", skip_serializing_if = "Option::is_none")]
18    pub at: Option<String>,
19    /// CostCents is what this unit resold for over the hour the reading falls in, in whole US cents. 0 means UNPRICED, not free: the operator's own machines — a linked run-target, a dialed-in BYO worker — are metered for utilization and never resold, so only a priced source ever fills it.
20    #[serde(rename = "costCents", skip_serializing_if = "Option::is_none")]
21    pub cost_cents: Option<i32>,
22    /// CPUs is logical cores. The static capability rides every row on purpose: a chart can size load against cores without joining a registry whose row may since have been rewritten or the unit deregistered.
23    #[serde(rename = "cpus", skip_serializing_if = "Option::is_none")]
24    pub cpus: Option<i32>,
25    /// GPUModel names the representative accelerator (\"GB10\"); GPUs carries how many.
26    #[serde(rename = "gpuModel", skip_serializing_if = "Option::is_none")]
27    pub gpu_model: Option<String>,
28    /// GPUUtil is aggregate accelerator utilization as a FRACTION of 1 — 0.42 is 42% busy. Anything a reporter sends outside 0..1 is clamped into it on write.
29    #[serde(rename = "gpuUtil", skip_serializing_if = "Option::is_none")]
30    pub gpu_util: Option<f64>,
31    /// GPUs is how many accelerators the reading covers.
32    #[serde(rename = "gpus", skip_serializing_if = "Option::is_none")]
33    pub gpus: Option<i32>,
34    /// Host is the hostname the unit reported at the time of the reading.
35    #[serde(rename = "host", skip_serializing_if = "Option::is_none")]
36    pub host: Option<String>,
37    /// Kind is what the measured unit is: laptop, cloud, gpu, cluster, machine or worker.
38    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
39    pub kind: Option<String>,
40    /// Load1 is the 1-minute load average — runnable processes, not a percentage.
41    #[serde(rename = "load1", skip_serializing_if = "Option::is_none")]
42    pub load1: Option<f64>,
43    /// Load5 is the 5-minute load average, the same units as Load1.
44    #[serde(rename = "load5", skip_serializing_if = "Option::is_none")]
45    pub load5: Option<f64>,
46    /// Load15 is the 15-minute load average, the same units as Load1.
47    #[serde(rename = "load15", skip_serializing_if = "Option::is_none")]
48    pub load15: Option<f64>,
49    /// MemFree is host memory available, in BYTES, as reported rather than derived.
50    #[serde(rename = "memFree", skip_serializing_if = "Option::is_none")]
51    pub mem_free: Option<i32>,
52    /// MemUsed is host memory in use, in BYTES.
53    #[serde(rename = "memUsed", skip_serializing_if = "Option::is_none")]
54    pub mem_used: Option<i32>,
55    /// Memory is total system RAM in BYTES at the time of the reading.
56    #[serde(rename = "memory", skip_serializing_if = "Option::is_none")]
57    pub memory: Option<i32>,
58    /// Source is the plane that reported the reading: \"agent\", \"byo\" or \"visor\" — the same vocabulary the board's rows carry, and what ?source= narrows on.
59    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
60    pub source: Option<String>,
61    /// Unit is the source's own id for the measured unit. With Source it is the key the chart groups by, and the key the board joins a unit's latest reading on.
62    #[serde(rename = "unit", skip_serializing_if = "Option::is_none")]
63    pub unit: Option<String>,
64}
65
66impl SampleView {
67    pub fn new() -> SampleView {
68        SampleView {
69            at: None,
70            cost_cents: None,
71            cpus: None,
72            gpu_model: None,
73            gpu_util: None,
74            gpus: None,
75            host: None,
76            kind: None,
77            load1: None,
78            load5: None,
79            load15: None,
80            mem_free: None,
81            mem_used: None,
82            memory: None,
83            source: None,
84            unit: None,
85        }
86    }
87}
88