ReportMetric report.metric@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- report
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/report/metric.v1.json
report.metric@1: one count computed or ingested by Report, with a UTC day or a window. Money values come from Billing's API; Report does not derive them. Mirrors OpenVibe.Report docs/report.metric.v1.json on origin/main.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
metric | string | yes |
| |
scope | enum | yes |
| |
scope_id | string | yes |
| |
day | string |
| ||
window_days | enum |
| ||
value | number | yes | ||
unit | enum | yes |
| |
source | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: day
{
"metric": "pageviews",
"scope": "site",
"scope_id": "network",
"day": "2026-10-28",
"value": 147,
"unit": "count",
"source": "network-stats"
}Valid: window
{
"metric": "watch_minutes",
"scope": "channel",
"scope_id": "carol",
"window_days": 7,
"value": 312.5,
"unit": "minutes",
"source": "live"
}Rejected: both-periods
{
"metric": "pageviews",
"scope": "network",
"scope_id": "network",
"day": "2026-10-28",
"window_days": 7,
"value": 147,
"unit": "count",
"source": "network-stats"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('report.metric@1', value); // { valid, errors: [{ path, message }] }