Skip to main content

获取系统内存、CPU、硬盘占用

Project description

SystemStatus

快速获取你的系统信息、CPU状态、内存状态和硬盘状态

⚠️注意 本模块仅仅返回信息,并不会真实使用适配器发送消息。您可能需要单独配置发送消息后才能使用。

使用

status = sdk.SystemStatus.get()
# 在这里处理你发送消息的逻辑

返回值

返回值是一个字典类型,您可以直接调用。 示例Json:

{
    "system": {
        "type": "Linux",
        "version": "Ubuntu 24.04 (noble)"
    },
    "memory": {
        "total": 937,
        "used": 401,
        "usage": "42.80%"
    },
    "cpu": {
        "cores": 1,
        "threads": 1,
        "usage": "1.0%"
    },
    "env": {
        "erispulse": "1.2.4",
        "python": "3.12.3"
    },
    "disk": {
        "total": "28.89GB",
        "used": "6.02GB",
        "usage": "20.84%"
    }
}

字段详解

字段名称 类型 用途
system dict 系统基础信息
system.type str 操作系统类型
system.version str 系统版本号
memory dict 内存使用情况
memory.total int 内存总量(MB)
memory.used int 已用内存(MB)
memory.usage str 内存使用率(%)
cpu dict CPU使用情况
cpu.cores int CPU物理核心数
cpu.threads int CPU逻辑线程数
cpu.usage str CPU使用率(%)
disk dict 磁盘使用情况
disk.total int 磁盘总容量(GB)
disk.used int 已用磁盘空间(GB)
disk.usage str 磁盘使用率(%)

参考链接

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

erispulse_systemstatus-1.0.3.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

erispulse_systemstatus-1.0.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file erispulse_systemstatus-1.0.3.tar.gz.

File metadata

  • Download URL: erispulse_systemstatus-1.0.3.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for erispulse_systemstatus-1.0.3.tar.gz
Algorithm Hash digest
SHA256 521e464afa45bc6d3e9a18e73204b99ad0da5bfd86b7235a0ad700fd4f77f79a
MD5 5cdc503325049749c487d544d9fc7725
BLAKE2b-256 2596bb085f02be6134756a93e6656011f701837974e4d0681fe6b10f0422e013

See more details on using hashes here.

File details

Details for the file erispulse_systemstatus-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for erispulse_systemstatus-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2be6b3fe0a664934ee16d367ef5c8084e9fe8eae28bbbc9155948c4f4d1ca09b
MD5 cc04a50817b243120ce80405ab88d42b
BLAKE2b-256 1545931e9f774c88cfac3ae925234da02691561b57071a2aa7e181711f8c4237

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page