-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
cpu.py
73 lines (62 loc) · 1.7 KB
/
cpu.py
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
# generated by datamodel-codegen:
# filename: cpu.json
from __future__ import annotations
from typing import Optional
from pydantic import BaseModel, Extra, Field
class LastUpdated(BaseModel):
"""
Last updated
"""
class Config:
extra = Extra.allow
count: float
frequency_current: float
frequency_min: float
frequency_max: float
load_average: float
stats_ctx_switches: float
stats_interrupts: float
stats_soft_interrupts: float
stats_syscalls: float
temperature: float
times_user: float
times_system: float
times_idle: float
times_interrupt: Optional[float] = None
times_dpc: Optional[float] = None
times_percent_user: float
times_percent_system: float
times_percent_idle: float
times_percent_interrupt: Optional[float] = None
times_percent_dpc: Optional[float] = None
usage: float
voltage: Optional[float] = None
class Cpu(BaseModel):
"""
CPU
"""
class Config:
extra = Extra.allow
count: int
frequency_current: float
frequency_min: float
frequency_max: float
load_average: float
stats_ctx_switches: int
stats_interrupts: int
stats_soft_interrupts: int
stats_syscalls: int
temperature: float
times_user: float
times_system: float
times_idle: float
times_interrupt: Optional[float] = None
times_dpc: Optional[float] = None
times_percent_user: float
times_percent_system: float
times_percent_idle: float
times_percent_interrupt: Optional[float] = None
times_percent_dpc: Optional[float] = None
usage: float
voltage: Optional[float] = None
last_updated: LastUpdated = Field(..., description="Last updated")