The Usage object
Viewer and AR event counts over a window, per period and per product.
UsageResponse
JavaScript: Usage · Python: viewrium.UsageResponse
startdatetimerequiredThe window's start (default: 30 days before end).
enddatetimerequiredThe window's end (default: now).
granularitystringrequiredThe bucket size: hour or day (default).
One of "hour", "day"
Event counts per period and event type.
totalsmap of string to integerrequiredEvent type -> count over the whole window.
Event type -> AR session length over the window. Only ever keyed by ar_session_ended, and absent when nothing reported one.
Per-product totals, best first and capped. Empty unless group_by=product asked for them.
UsageBucket
JavaScript: no alias - an element of the type that holds it · Python: viewrium.UsageBucket
period_startdatetimerequiredThe start of the hour or day this bucket covers.
event_typeUsageEventTyperequiredThe event counted.
One of "generation.created", "generation.completed", "generation.failed", "view", "ar_enter", "ar_session_ended"
countintegerrequiredHow many events of this type fell in the period.
cost_centsnumberoptionalnullableThe summed cost of the bucket's priced events, in cents. Null when none carried a price.
AR session length; set only for ar_session_ended, and null when no event in the bucket reported one.
UsageDuration
JavaScript: no alias - an element of the type that holds it · Python: viewrium.UsageDuration
Total AR session time and how many sessions reported one. The average session is total_ms /
count; count is not the bucket's event count, because not every session reports a duration.
total_msintegerrequiredSummed AR session length in milliseconds.
countintegerrequiredHow many sessions contributed a duration - the divisor for an average (total_ms / count).
UsageProductTotals
JavaScript: UsageProductTotals · Python: viewrium.UsageProductTotals
One product's event counts over the window, with its title. Returned when group_by=product.
product_iduuidrequiredThe product.
titlestringoptionalnullableThe product's title.
totalsmap of string to integerrequiredEvent type -> count over the window.