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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
use serde::{Serialize, Deserialize};
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct DiskUsage {
pub name: String,
pub used: u64,
pub total: u64,
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Process {
pub pid: i32,
pub cpu: f64,
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct GraphicsProcessUtilization {
pub pid: u32,
pub gpu: u32,
pub memory: u32,
pub encoder: u32,
pub decoder: u32
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct GraphicsUsage {
pub id: String,
pub memory_usage: u32,
pub memory_used: u64,
pub encoder: u32,
pub decoder: u32,
pub gpu: u32,
pub temperature: u32,
pub processes: Vec<GraphicsProcessUtilization>
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct SystemStatus {
pub memory: i32,
pub cpu: i32,
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct SystemInfo {
pub os_name: String,
pub kernel_version: String,
pub os_version: String,
pub hostname: String,
pub distribution: String,
pub memory: u64,
pub processor: Processor,
pub total_processors: usize,
pub graphics: Vec<GraphicCard>,
pub disks: Vec<Disk>,
pub cameras: Vec<Camera>,
pub nvidia: Option<NvidiaInfo>,
pub vaapi: bool,
pub model: Option<String>
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Processor {
pub frequency: u64,
pub vendor: String,
pub brand: String
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct GraphicCard {
pub id: String,
pub name: String,
pub brand: String,
pub memory: u64,
pub temperature: u32
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Disk {
pub name: String,
pub fs: String,
pub storage_type: String,
pub mount_point: String,
pub available: u64,
pub size: u64
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Camera {
pub name: String,
pub path: String
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NvidiaInfo {
pub driver_version: String,
pub nvml_version: String,
pub cuda_version: i32,
}