# ubus API Reference

## qos.queue_stats

Retrieves per-queue transmit and drop statistics.

**Input:**

| Parameter | Type | Required | Description |
|---|---|---|---|
| ifname | string | No | Interface name (e.g., "ae_wan"). Omit for all interfaces. |
| qid | integer | No | Queue ID (0-7). Omit for all queues on the interface. |

**Output:**

```json
{
  "queues": [
    {
      "qid": <integer>,
      "iface": "<string>",
      "tx_packets": <integer>,
      "tx_bytes": <integer>,
      "tx_dropped_packets": <integer>,
      "tx_dropped_bytes": <integer>
    }
  ]
}
```

**Examples:**

```bash
# Stats for a specific queue on a specific interface
ubus call qos queue_stats '{"ifname":"ae_wan", "qid":5}'

# All queues on a specific interface
ubus call qos queue_stats '{"ifname":"ae_wan"}'

# All queues on all interfaces
ubus call qos queue_stats
```
