ToolsAnalyticsReadResult tools.analytics-read-result@1

Generated at from openvibe-contracts v0.79.0 and openvibe-sdk v0.25.0.

Version
1.0.0
Owner
tools
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/tools/analytics-read-result.v1.json

tools.analytics-read-result@1: the answer of GET /api/internal/analytics on the Tools gateway and on each satellite (capability tools.analytics.read; internal key plus loopback only): { ok: true, analytics } — the satellites' analytics added up (summary totals, realtime, per-app numbers, with the busiest satellite's detail tables beside them) for Network's admin dashboard. Aggregate counts only, never rows; analytics is open (its shape is each satellite's).

Fields

FieldTypeRequiredDescriptionConstraints
okconstyes
  • = true
analyticsobjectyesAggregate analytics; open.

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: rollup
{
  "ok": true,
  "analytics": {
    "summary": {
      "total_pageviews": 40231,
      "avg_response_ms": 84
    },
    "realtime": {
      "online": 12
    },
    "apps": [
      {
        "name": "img",
        "total_pageviews": 20000
      },
      {
        "name": "docs",
        "total_pageviews": 20231
      }
    ]
  }
}
Rejected: no-analytics
{
  "ok": true
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('tools.analytics-read-result@1', value);   // { valid, errors: [{ path, message }] }