Skip to main content

Metrics Server

Broadcast live device metrics to nearby devices over Bluetooth LE.

Metrics Server: status card with configurable server name, server controls, connected clients count, and current metrics.
Set a custom server name or choose from presets like marketing name, model identifier, or device name.
Current Metrics card showing CPU usage, core count, device name, and a live usage history graph.

Overview

Metrics Server turns your device into a Bluetooth Low Energy (BLE) peripheral that broadcasts live device metrics to nearby devices running Metrics Client. Connected clients receive a continuous stream of data including CPU usage, per-core CPU activity, device identity information, and timestamps — all transmitted once per second over BLE notify characteristics.

This is useful for monitoring one device's performance from another in real time, without requiring a Wi-Fi network or any infrastructure.

Table Of Contents

Main Sections

Metrics Server is a single scrolling screen with four cards:

  • Metrics Server — status and server name configuration
  • Server Controls — start/stop the BLE broadcast
  • Connected Clients — count of subscribed devices
  • Current Metrics — live preview of the data being broadcast

Metrics Server Status Card

The top card displays:

  • A running indicator — a colored dot with a label:
    • Running (green) — the server is actively advertising and transmitting.
    • Stopped (red) — the server is not advertising.
  • Server Name field — an editable text field that determines the name other devices will see during BLE discovery. See Server Name And Presets for details.
  • Status — Active or Inactive.
  • Bluetooth Status — the current Bluetooth radio state (Powered On, Powered Off, Unauthorized, Unsupported, Resetting, Unknown).
  • Connected — the number of client devices currently subscribed to the metrics stream.
  • Error — any error message from the BLE stack (only shown when an error occurs).

Server Name And Presets

The server name determines how this device appears to Metrics Client users during discovery. You can type any custom name, or use the Presets dropdown to quickly apply one of the built-in options:

PresetExample
Marketing name + model identifieriPhone 16 Pro Max (iPhone17,2)
Marketing name onlyiPhone 16 Pro Max
Model identifier onlyiPhone17,2
Device nameRogerio's iPhone 16ProMax

The default is Marketing name (Model identifier) when available.

Changing the name while the server is running automatically restarts BLE advertising so the new name takes effect immediately.

Server Controls

The Server Controls card contains a single Start Server / Stop Server button:

  • Start Server (green) — begins BLE advertising and starts collecting CPU metrics. The server will begin transmitting data as soon as a client subscribes.
  • Stop Server (red) — stops BLE advertising and halts metric collection.

A description below the button explains that the server broadcasts metrics to connected clients over Bluetooth LE.

Connected Clients

The Connected Clients card shows:

  • The number of currently subscribed client devices (displayed prominently as a large number).
  • When no clients are connected: a placeholder with an icon and a message to start the server and use Metrics Client on another device.
  • When clients are connected: a confirmation message showing the count (e.g. "1 client is receiving metrics").

The server only transmits data when at least one client is subscribed. When no clients are connected, the internal timer is paused to conserve resources.

Current Metrics

The Current Metrics card shows a live preview of the data being broadcast:

FieldDescription
CPU UsageThe current overall CPU usage percentage of this device (e.g. 30.0%).
Core CountThe number of CPU cores on this device (e.g. 6).
DeviceThe user-assigned device name (e.g. "Rogerio's iPhone 16ProMax").

Below these fields, a Usage History line graph shows the CPU usage over time, giving a visual sense of how the workload fluctuates.

Transmitted Data

The server broadcasts two BLE notify characteristics once per second to all subscribed clients:

Summary Characteristic

Contains the following fields in a compact binary payload:

FieldTypeDescription
Server NameString (up to 32 chars)The configurable name shown in the status card.
Device ModelString (up to 32 chars)The device's marketing name (e.g. "iPhone 16 Pro Max").
Device NameString (up to 32 chars)The user-assigned device name from iOS Settings.
CPU UsageFloat (32-bit)Overall CPU usage as a percentage (0–100).
Core CountUInt16Number of CPU cores.
TimestampUInt64Milliseconds since Unix epoch.

Per-Core Characteristic

Contains per-core CPU usage data:

FieldTypeDescription
Core CountUInt8Number of cores (up to 32).
Core UsagesFloat[]One 32-bit float per core, representing that core's usage percentage.
TimestampUInt64Milliseconds since Unix epoch.

How To Use With Metrics Client

  1. On the device you want to observe, open Tools > Metrics Server and tap Start Server.
  2. On another device, open Tools > Metrics Client.
  3. In the Discovery tab, find the server in the list and tap Connect.
  4. The client automatically switches to the Metrics tab to display live data.

Technical Details

  • The server acts as a BLE Peripheral using CBPeripheralManager. It advertises a custom GATT service with two notify-only characteristics (summary and per-core).
  • Data is transmitted once per second when at least one client is subscribed. The timer is paused when no clients are connected.
  • All multi-byte numeric values in the payload are little-endian, as produced natively by Swift on Apple platforms.
  • The server uses CoreBluetooth state restoration, allowing it to recover advertising state if the app is relaunched by the system.
  • BLE backpressure is handled gracefully — if the transmit queue is full, updates are queued and drained when the system signals readiness via peripheralManagerIsReady(toUpdateSubscribers:).
  • CPU metrics are sampled from the same ToolCPUViewModel used by the CPU Monitor tool, ensuring consistent readings.

Notes And Limitations

  • This tool uses Bluetooth LE, not Wi-Fi networking. Devices must be within BLE range (typically 10–30 meters indoors).
  • BLE availability, background behavior, and connection stability vary by device and OS version.
  • On visionOS, Metrics Server is unavailable because the BLE peripheral role is not supported.
  • The server name is limited to 32 characters due to BLE payload size constraints.
  • Only CPU-related metrics are currently transmitted. Other device metrics (memory, thermals, etc.) are not included in the BLE stream.