platypush/platypush/schemas/system/_memory/_model.py
Fabio Manganiello 98a300c4b1
Added NetworkInterface entities to system plugin.
Plus, `platypush.schemas.system` has now been split into multiple
submodules to avoid a single-file mega-module with all the system
schemas definitions.
2023-04-21 00:45:15 +02:00

117 lines
2.2 KiB
Python

from dataclasses import dataclass, field
from .._base import percent_field
@dataclass
class MemoryStats:
"""
Memory stats data class.
"""
total: int = field(
metadata={
'metadata': {
'description': 'Total available memory, in bytes',
}
}
)
available: int = field(
metadata={
'metadata': {
'description': 'Available memory, in bytes',
}
}
)
used: int = field(
metadata={
'metadata': {
'description': 'Used memory, in bytes',
}
}
)
free: int = field(
metadata={
'metadata': {
'description': 'Free memory, in bytes',
}
}
)
active: int = field(
metadata={
'metadata': {
'description': 'Size of the active memory, in bytes',
}
}
)
inactive: int = field(
metadata={
'metadata': {
'description': 'Size of the inactive memory, in bytes',
}
}
)
buffers: int = field(
metadata={
'metadata': {
'description': 'Size of the buffered memory, in bytes',
}
}
)
cached: int = field(
metadata={
'metadata': {
'description': 'Size of the cached memory, in bytes',
}
}
)
shared: int = field(
metadata={
'metadata': {
'description': 'Size of the shared memory, in bytes',
}
}
)
percent: float = percent_field()
@dataclass
class SwapStats:
"""
Swap memory stats data class.
"""
total: int = field(
metadata={
'metadata': {
'description': 'Total available memory, in bytes',
}
}
)
used: int = field(
metadata={
'metadata': {
'description': 'Used memory, in bytes',
}
}
)
free: int = field(
metadata={
'metadata': {
'description': 'Free memory, in bytes',
}
}
)
percent: float = percent_field()