MCPcopy Create free account
hub / github.com/apify/crawlee-python / CpuInfo

Class CpuInfo

src/crawlee/_utils/system.py:36–56  ·  view source on GitHub ↗

Information about the CPU usage.

Source from the content-addressed store, hash-verified

34
35
36class CpuInfo(BaseModel):
37 """Information about the CPU usage."""
38
39 model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)
40
41 used_ratio: Annotated[float, Field(alias='usedRatio')]
42 """The ratio of CPU currently in use, represented as a float between 0 and 1."""
43
44 # Workaround for Pydantic and type checkers when using Annotated with default_factory
45 if TYPE_CHECKING:
46 created_at: datetime = datetime.now(timezone.utc)
47 """The time at which the measurement was taken."""
48 else:
49 created_at: Annotated[
50 datetime,
51 Field(
52 alias='createdAt',
53 default_factory=lambda: datetime.now(timezone.utc),
54 ),
55 ]
56 """The time at which the measurement was taken."""
57
58
59class MemoryUsageInfo(BaseModel):

Calls

no outgoing calls