Usage Activity Dashboard

Understand how the dashboard surfaces active users and query volume

Last updated: 1/19/2025

The Usage Activity Dashboard summarizes how people inside your organization interact with ContextFlo over the last 7 or 30 days. It is powered entirely by pre-computed rollups so the experience stays fast and consistent.

Data Sources

  • mcpEventLog captures every MCP event, including the userId, organizationId, optional userPrompt, and the timestamp.
  • organizationUsageRollup stores daily, 7-day, and 30-day aggregates. The runDailyUsageRollup job computes the rollups once per day (UTC) and writes three rows per organization: DAILY, ROLLING_7_DAY, and ROLLING_30_DAY.

If the job has never run for an organization, the API falls back to computing metrics straight from mcpEventLog.

Time Windows

The toggle in the top-right selects the window:

  • Last 7 Days uses the ROLLING_7_DAY row whose statDate is the most recent available.
  • Last 30 Days uses the ROLLING_30_DAY row.

When a window is selected the UI also fetches the underlying DAILY rollups covering the same range. Missing days are not backfilled—only dates with actual data are returned.

Metric Definitions

Each summary card is derived as follows.

Total Active Users

activeUserCount from the selected rollup. It counts unique userId values within the window.

Daily Average Users

Average of the activeUserCount field across the returned daily rollups:

Math.round(sum(activeUserCount per day) / number of daily rows)

Only days with data contribute to the denominator, so gaps do not dilute the average.

Total Queries

totalInteractions from the selected rollup. The rollup job counts distinct, non-null userPrompt strings within the window.

Daily Avg Queries

Average of totalInteractions across the daily rollups:

Math.round(sum(totalInteractions per day) / number of daily rows)

Again, the denominator is the number of days that have a DAILY rollup. Days with zero activity simply have no row and therefore do not affect the average.

Period-over-period deltas

For the “Total Active Users” and “Total Queries” cards the API also returns the previous rollup (ROLLING_7_DAY or ROLLING_30_DAY whose statDate is on or before the start of the previous window). The UI shows the absolute value and an up/down arrow; percentages are computed in the API.

Charts

Two bar charts render the DAILY rollups:

  • Active Users per Day – plots activeUserCount.
  • Queries per Day – plots totalInteractions.

Because only dates with rollups are returned, gaps in the chart correspond to days with no recorded activity. Hover tooltips show the full UTC date and value.

Troubleshooting Tips

  • If the cards show all zeros while charts display data, confirm the runDailyUsageRollup job ran recently; the summary cards depend on the ROLLING_* rows.
  • If you expect a day to appear but the chart skips it, ensure the organizationUsageRollup table has a DAILY row for that date. The API does not synthesize blank days.
  • The average cards use integers (via Math.round). If you need decimals, adjust the UI logic before rounding.

Use this dashboard when you need a quick read on organization engagement and to compare current usage against the prior period.