Skip to content

mcp-data-platform-v0.36.1

Choose a tag to compare

@github-actions github-actions released this 08 Mar 19:34
· 77 commits to main since this release
d5a1cee

Fix: Zero-Fill Timeseries Chart Gaps for Sparse Activity Data (#201)

Activity timeseries charts (admin dashboard and portal user activity) collapsed to just the data points when usage was sparse, losing all temporal context on the X-axis. For example, 2 tool calls in a 24-hour window produced a chart with only 2 points instead of a full 24-hour timeline.

Root Cause

The Timeseries() SQL query uses GROUP BY date_trunc(resolution, timestamp), which only returns buckets that contain data. With sparse usage, the chart rendered a compressed line between the few populated points with no sense of scale.

Fix

Added a Go-side ZeroFill helper that expands sparse SQL results into a complete series covering [start, end] at the requested resolution. Missing buckets are filled with zero values.

Before: 2 events in a 24h window → chart with 2 points, no time scale
After: 2 events in a 24h window → chart with 24 hourly buckets, two visible spikes against a zero baseline

Why Go-side instead of SQL generate_series

  • Keeps the existing squirrel-based SQL builder unchanged (lower risk)
  • Pure Go logic is trivially testable with table-driven tests
  • Not PostgreSQL-specific — works with any future store implementation

Frontend: Sparse Data Dots

When there are 10 or fewer non-zero data points, dots (r: 3) are shown on the success and error lines so sparse spikes are visible against the zero baseline.

Files Changed

File Change
pkg/audit/zerofill.go New: ZeroFill, resolutionInterval, truncateTime helpers
pkg/audit/zerofill_test.go New: 8 table-driven cases + data preservation, invalid resolution, helper unit tests
pkg/audit/postgres/metrics.go Call audit.ZeroFill() after SQL query
pkg/audit/postgres/metrics_test.go Updated 3 tests to use fixed times and verify zero-filled output
ui/src/components/charts/TimeseriesChart.tsx Conditional dots on sparse data

Total: 5 files changed, 317 insertions, 21 deletions


Installation

Homebrew (macOS)

brew install txn2/tap/mcp-data-platform

Claude Code CLI

claude mcp add mcp-data-platform -- mcp-data-platform

Docker

docker pull ghcr.io/txn2/mcp-data-platform:v0.36.1

Verification

All release artifacts are signed with Cosign. Verify with:

cosign verify-blob --bundle mcp-data-platform_0.36.1_linux_amd64.tar.gz.sigstore.json \
  mcp-data-platform_0.36.1_linux_amd64.tar.gz