stats dom
This commit is contained in:
parent
89ba74f1f7
commit
e9f910ea23
|
@ -0,0 +1,9 @@
|
|||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from time import time_ns
|
||||
|
||||
class CPU(BaseModel):
|
||||
model_config = ConfigDict()
|
||||
time:int = Field(default_factory=time_ns)
|
||||
user:int = Field()
|
||||
system:int = Field()
|
||||
count:int = Field()
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
from pydantic import UUID4, BaseModel, ConfigDict, Field
|
||||
from time import time_ns
|
||||
|
||||
class DiskFlows(BaseModel):
|
||||
bytes:int = Field()
|
||||
reqs:int = Field()
|
||||
times:int = Field()
|
||||
|
||||
class Disk(BaseModel):
|
||||
model_config = ConfigDict()
|
||||
time:int = Field(default_factory=time_ns)
|
||||
uuid:UUID4 = Field()
|
||||
name:str = Field()
|
||||
read:DiskFlows = Field()
|
||||
write:DiskFlows = Field()
|
|
@ -0,0 +1,18 @@
|
|||
from typing import Optional
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
class MemorySwap(BaseModel):
|
||||
swp_in:int = Field(serialization_alias="in")
|
||||
swp_out:Optional[int] = Field(default=None, serialization_alias="out")
|
||||
|
||||
class Memory(BaseModel):
|
||||
model_config = ConfigDict()
|
||||
time:int = Field()
|
||||
available:Optional[int] = Field(default=None)
|
||||
current:int = Field()
|
||||
maximum:int = Field()
|
||||
disk_caches:Optional[int] = Field(default=None)
|
||||
rss:int = Field()
|
||||
swap:MemorySwap = Field()
|
||||
unused:Optional[int] = Field(default=None)
|
||||
usable:Optional[int] = Field(default=None)
|
|
@ -0,0 +1,18 @@
|
|||
from typing import Any, List
|
||||
from pydantic import UUID4, BaseModel, ConfigDict, Field
|
||||
from time import time_ns
|
||||
|
||||
class InterfaceFlows(BaseModel):
|
||||
bytes:int = Field()
|
||||
drop:int = Field()
|
||||
errs:int = Field()
|
||||
pkts:int = Field()
|
||||
|
||||
class Interface(BaseModel):
|
||||
model_config = ConfigDict()
|
||||
|
||||
uuid:UUID4 = Field()
|
||||
time:int = Field(default_factory=time_ns)
|
||||
name:str = Field()
|
||||
rx:InterfaceFlows = Field()
|
||||
tx:InterfaceFlows = Field()
|
Loading…
Reference in New Issue