# Daily IB Volume/Usage Report

LLMS index: [llms.txt](/llms.txt)

---

<div id="pslens-context-panel" class="card border-info mb-4 d-none">
  <div class="card-header bg-light text-info py-2 fw-bold d-flex align-items-center border-bottom border-info-subtle">
    <i class="bi bi-info-circle-fill me-2"></i>
    <span>Tailored Operational Context</span>
  </div>
  <div class="card-body p-0">
    <ul class="list-group list-group-flush">
      <li id="row-db" class="list-group-item d-flex align-items-center justify-content-between py-2 d-none">
        <strong>Target Database:</strong>
        <span id="ctx-db" class="badge bg-secondary font-monospace">&mdash;</span>
      </li>
      <li id="row-type" class="list-group-item d-flex align-items-center justify-content-between py-2 d-none">
        <strong>Context Type:</strong>
        <span id="ctx-type" class="badge bg-light text-dark border font-monospace text-uppercase">&mdash;</span>
      </li>
      <li id="row-severity" class="list-group-item d-flex align-items-center justify-content-between py-2 d-none">
        <strong>Alert Severity:</strong>
        <span id="ctx-severity" class="badge">&mdash;</span>
      </li>
      <li id="row-time" class="list-group-item d-flex align-items-center justify-content-between py-2 d-none">
        <strong>Triggered Time:</strong>
        <span id="ctx-time" class="text-muted small">&mdash;</span>
      </li>
      <li id="row-details" class="list-group-item py-2 d-none">
        <strong id="label-details" class="d-block mb-1">Firing Context:</strong>
        <code id="ctx-details" class="d-block p-2 bg-light border rounded small" style="white-space: pre-wrap; word-break: break-all;">&mdash;</code>
      </li>
    </ul>
  </div>
</div>

<script>
  (function() {
    const params = new URLSearchParams(window.location.search);
    const metadata = params.get('metadata');
    if (!metadata) return;

    try {
      
      const base64 = metadata.replace(/-/g, '+').replace(/_/g, '/');
      const jsonStr = decodeURIComponent(escape(window.atob(base64)));
      const data = JSON.parse(jsonStr);

      if (data) {
        let hasData = false;

        if (data.db) {
          document.getElementById('ctx-db').textContent = data.db;
          document.getElementById('row-db').classList.remove('d-none');
          hasData = true;
        }

        if (data.type) {
          document.getElementById('ctx-type').textContent = data.type;
          document.getElementById('row-type').classList.remove('d-none');
          hasData = true;
        }

        if (data.severity) {
          const severityBadge = document.getElementById('ctx-severity');
          const severity = data.severity.toLowerCase();
          severityBadge.textContent = severity.toUpperCase();
          if (severity === 'critical') {
            severityBadge.className = 'badge bg-danger';
          } else if (severity === 'warning') {
            severityBadge.className = 'badge bg-warning text-dark';
          } else {
            severityBadge.className = 'badge bg-info';
          }
          document.getElementById('row-severity').classList.remove('d-none');
          hasData = true;
        }

        if (data.t) {
          const date = new Date(data.t * 1000);
          document.getElementById('ctx-time').textContent = date.toLocaleString();
          document.getElementById('row-time').classList.remove('d-none');
          hasData = true;
        }

        if (data.details) {
          document.getElementById('ctx-details').textContent = data.details;

          
          const labelDetails = document.getElementById('label-details');
          if (data.type === 'object') {
            labelDetails.textContent = 'Object Metadata Details:';
          } else if (data.type === 'report') {
            labelDetails.textContent = 'Report Description:';
          } else {
            labelDetails.textContent = 'Firing Context:';
          }

          document.getElementById('row-details').classList.remove('d-none');
          hasData = true;
        }

        if (hasData) {
          document.getElementById('pslens-context-panel').classList.remove('d-none');
        }
      }
    } catch (e) {
      console.error('Failed to parse operational context metadata:', e);
    }
  })();
</script>


## Daily IB Volume/Usage Report

**Report ID:** `ib-daily-volume`
**Category:** Integration Broker

## Purpose

This report shows Integration Broker message volume for a configurable date range. It breaks down traffic into four categories:

1. **Async Operations** — publication headers (PSAPMSGPUBHDR), the top-level async message record
2. **Publication Contracts** — per-subscriber delivery records (PSAPMSGPUBCON)
3. **Subscription Contracts** — subscription handler execution records (PSAPMSGSUBCON)
4. **Synchronous Operations** — logged sync transactions (PSIBLOGHDR). Only operations with logging enabled appear here

Each category shows counts grouped by operation name and status (Done, Error, New, etc.), sorted by total volume descending.

## Parameters

|  Parameter  |      Default       |             Description             |
| ----------- | ------------------ | ----------------------------------- |
| `from_date` | Today (YYYY-MM-DD) | Start of the date range (inclusive) |
| `to_date`   | Today (YYYY-MM-DD) | End of the date range (inclusive)   |

Leave both parameters blank to report on today's traffic. Set a range such as `from_date=2026-01-01` and `to_date=2026-01-31` for a monthly view.

## Tables Queried

### PSAPMSGPUBHDR — Async Operation Headers

The master record for each async IB message (one row per publication).

|      Field       |               Description               |      Filter       |
| ---------------- | --------------------------------------- | ----------------- |
| IB_OPERATIONNAME | Service operation name                  | Grouped by        |
| STATUSSTRING     | Message status (DONE, ERROR, NEW, etc.) | Grouped by        |
| CREATEDTTM       | When the record was created             | Date range filter |

### PSAPMSGPUBCON — Publication Contracts

One row per subscriber for each async publication.

|      Field       |         Description         |      Filter       |
| ---------------- | --------------------------- | ----------------- |
| IB_OPERATIONNAME | Service operation name      | Grouped by        |
| STATUSSTRING     | Contract status             | Grouped by        |
| CREATEDTTM       | When the record was created | Date range filter |

### PSAPMSGSUBCON — Subscription Contracts

One row per subscription handler execution.

|      Field       |         Description         |      Filter       |
| ---------------- | --------------------------- | ----------------- |
| IB_OPERATIONNAME | Service operation name      | Grouped by        |
| STATUSSTRING     | Contract status             | Grouped by        |
| CREATEDTTM       | When the record was created | Date range filter |

### PSIBLOGHDR — Sync Operation Log Headers

Logged synchronous transaction records. Only populated when message detail logging is enabled on the routing.

|      Field       |            Description             |      Filter       |
| ---------------- | ---------------------------------- | ----------------- |
| IB_OPERATIONNAME | Service operation name             | Grouped by        |
| STATUSSTRING     | Transaction status                 | Grouped by        |
| PUBLISHTIMESTAMP | When the transaction was processed | Date range filter |

## Data Flow

```text
1. Fetch async operation summary (PSAPMSGPUBHDR)
   GROUP BY IB_OPERATIONNAME, STATUSSTRING
        |
        v
2. Fetch publication contract summary (PSAPMSGPUBCON)
   GROUP BY IB_OPERATIONNAME, STATUSSTRING
        |
        v
3. Fetch subscription contract summary (PSAPMSGSUBCON)
   GROUP BY IB_OPERATIONNAME, STATUSSTRING
        |
        v
4. Fetch sync operation summary (PSIBLOGHDR)
   GROUP BY IB_OPERATIONNAME, STATUSSTRING
        |
        v
5. Pivot each dataset into a per-operation table
   with status columns, sorted by total descending
```

## Report Output

The generated report contains:

- **Summary table** with total message counts for each of the four categories
- **Async Operations table** — one row per operation, columns for each status (Done, Error, New, etc.) plus Total
- **Publication Contracts table** — same format
- **Subscription Contracts table** — same format
- **Synchronous Operations table** — same format, with a note that only logging-enabled operations appear

## Interpreting Results

### Async Operations

- **Done** — successfully processed and delivered
- **Error** — failed; check the IB Monitor for details
- **New** — queued but not yet processed (may indicate a stuck dispatcher)

A high **Error** count relative to **Done** signals a systemic integration problem. A high **New** count with no decrease over time indicates the IB dispatcher may be stopped.

### Publication vs Subscription Contracts

- Each async publication spawns one publication contract (PSAPMSGPUBCON) per subscribing node
- Subscription contracts (PSAPMSGSUBCON) represent individual handler executions
- If pub contract count is much higher than sub contract count, some subscribers may not be processing

### Synchronous Operations

- Only operations with **logging enabled** on their routing appear here
- A missing operation does not mean it had no traffic. It may have logging disabled
- Cross-reference with the [Sync Operations Without Logging](ib-sync-no-logging) report to identify gaps

## Recommendations

1. **Monitor daily Error rates** — set a threshold and investigate any day where errors exceed it
2. **Watch for New status growth** — a queue of unprocessed messages indicates a dispatcher or handler problem
3. **Enable sync logging** for critical operations to get visibility in this report (see [Sync Operations Without Logging](ib-sync-no-logging))
4. **Compare day-over-day volumes** — sudden drops may indicate a sending system stopped, not just low traffic
