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.2.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.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: erispulse_systemstatus-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 2b7ae30537188327d34517d045be986faff5242753476e08638554ede7e40af7
MD5 ca05c957c1952f6319c11f920b1a5e7d
BLAKE2b-256 9f2c25dc71de413d403d669da790446642bb46f52090732f8570c09d59193e55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for erispulse_systemstatus-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8abcfcbc5d1b171371ec3d5f031328be98c0189b55c9cc8d6fb918114e2237f6
MD5 437cb342b7b9ec54b040686a95c55641
BLAKE2b-256 f0b0bd319e756811ce3575ac1b17d92a6918767b18ad7cf2cecfd80a75ff0b07

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