stats dom

This commit is contained in:
Mickael BOURNEUF 2024-10-23 12:30:58 +02:00
parent 89ba74f1f7
commit e9f910ea23
6 changed files with 62 additions and 1 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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)

View File

@ -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()

View File

@ -2,7 +2,7 @@ from setuptools import find_packages, setup
setup(
name='deevirt_schema',
version='0.1.0',
version='0.1.1',
description='Deevirt Schema',
url='https://git.celeonet.fr/Deevirt/deevirt_schema.git',
author='Celeonet',