Skip to content

Expose engine runtime and P2P metrics #4

Description

@jevgeni17

Goal

Expose safe, typed measurements of the managed engine's P2P activity and computer-resource use.

Scope

  • Add typed SessionStatistics for status, active peers, download/upload rates, and downloaded/uploaded totals from the validated Ace Stream session statistics endpoint.
  • Add typed EngineRuntimeMetrics for container state, uptime, CPU usage, memory usage/limit, process count, and cache usage/configured limit.
  • Obtain Docker metrics only for the labelled EngineKit-managed container using fixed Process argument arrays; never execute a shell or accept arbitrary container names or Docker arguments.
  • Do not label Docker network transmit bytes as P2P upload: they also include the local HTTP stream sent to IINA. Ace Stream session statistics are authoritative for peer transfer figures.
  • Provide bounded, cancellable snapshot collection suitable for periodic UI refresh.
  • Represent unsupported, temporarily unavailable, and stale measurements explicitly. Metrics failure must never interrupt playback.
  • Keep content IDs, stream URLs, VPN keys, and arbitrary Docker output out of logs and diagnostics.

Acceptance criteria

  • The API reports session statistics and runtime metrics with clear units and timestamps.
  • Collection tolerates engine startup, shutdown, replacement, and temporary API failures.
  • Collection cannot target an unrelated container and has bounded frequency and overhead.
  • Tests cover HTTP and Docker metric parsing, unavailable fields, stale data, cancellation, and exact process arguments.
  • Docker network I/O is never exposed as peer upload/download.

Non-goals

  • Setting resource or bandwidth limits.
  • Rendering statistics in the macOS application.

Consumer

AceStreamPlayer #3 will present these metrics.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions