Skip to main content

Real-time CPU monitor. Track performance, temperature, and usage stats instantly.

Project description

cc.StatusQ-kit

Efficient monitoring and management of CPU status.

License: MIT Version test(https://github.com/Rick-torrellas/cc.StatusQ-kit/actions/workflows/main.yaml) Python Version Download docs Ask DeepWiki

📖 Description

StatusQ is a modular, event-driven monitoring engine designed to decouple system data collection from the presentation layer. Built on a robust Event Bus (Pub-Sub) architecture, it allows you to observe system metrics (like CPU, Memory, or Network) through a platform-agnostic core.


Installation

pip install cc.statusq-kit

Usage

from cc_statusq_cpu.core import StatusqCPU, CPUEventBus
from cc_statusq_cpu.capsule import PsutilCPUProvider
from cc_statusq_kit.core.StatusQ import StatusQ
from cc_statusq_kit.core.SystemEventBus import SystemEventBus
from cc_statusq_kit.capsule.CPUAdapter import CPUAdapter
from cc_statusq_kit.capsule.ConsoleAdapter import ConsoleAdapter

# 1. Initialize the Global System Event Bus
global_bus = SystemEventBus()
cpu_provider = PsutilCPUProvider()
# 2. Initialize Sub-system components (Specific to CPU Library)
cpu_bus = CPUEventBus()
cpu_app = StatusqCPU(provider=cpu_provider,event_bus=cpu_bus)
# 3. Create the Orchestrator
orchestrator = StatusQ(event_bus=global_bus)
# 4. Initialize and Register Adapters
# The ConsoleAdapter listens for HealthReportEvents on the global bus
console = ConsoleAdapter(global_bus=global_bus)

# The CPUAdapter translates specific CPU events into global HealthReportEvents
cpu_monitor = CPUAdapter(cpu_app=cpu_app, cpu_bus=cpu_bus, global_bus=global_bus)
orchestrator.register_child(console)
orchestrator.register_child(cpu_monitor)
# --- EXECUTION MODES ---
# MODE A: Single Pulse (Manual check)
print("--- Executing Single Pulse ---")
orchestrator.pulse_all()
# MODE B: Continuous Telemetry Stream (Multi-threaded)
print("\n--- Starting Telemetry Stream (Press Ctrl+C to stop) ---")
try:
    # Starts a background thread for each child to stream data every 2 seconds
    orchestrator.telemetry_stream(interval=2.0)
except KeyboardInterrupt:
    print("\nStopping orchestrator...")

📈 System Flow

  • Registration: Adapters are added to the StatusQ child list.
  • Trigger: When pulse_all() or telemetry_stream() is called, the orchestrator invokes the corresponding methods on the adapters.
  • Translation: The CPUAdapter captures hardware data and publishes a HealthReportEvent to the SystemEventBus.
  • Consumption: The ConsoleAdapter receives the event via the bus and displays the formatted metrics.

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

cc_statusq_core-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

cc_statusq_core-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file cc_statusq_core-0.1.0.tar.gz.

File metadata

  • Download URL: cc_statusq_core-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cc_statusq_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bc409fd7a33330e4ea47d4ad4e3789ebf881c57a6855c483e7c8585ea7c17ffa
MD5 7b7f6f55aa084aa86a9fd170267b7e7f
BLAKE2b-256 baab44aed1fa85b5ed47c64b91e45e2a60df2c75e9abcb35419f8ab8eff5c7dd

See more details on using hashes here.

File details

Details for the file cc_statusq_core-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cc_statusq_core-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cc_statusq_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6530ae15f92857c82b9a0e3736e4b37edb098aa00dd449fe4640dd3d0098b4c
MD5 1d1c299b0d22304030704dbb5e18ce25
BLAKE2b-256 164988a85e40169fdb2dfaa3d124e0457da64dbbc134256ec2684f9e5e8e075f

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