Skip to content

Story 15.3: JOIN query counter — elasticsql (TelemetryCollector + TelemetryData)#111

Merged
fupelaqu merged 1 commit into
release-r1from
feature/15.3
Jun 22, 2026
Merged

Story 15.3: JOIN query counter — elasticsql (TelemetryCollector + TelemetryData)#111
fupelaqu merged 1 commit into
release-r1from
feature/15.3

Conversation

@fupelaqu

Copy link
Copy Markdown
Contributor

Story 15.3 — JOIN query counter (elasticsql / licensing)

Closes #110. Part of Epic 15 (telemetry). Adds the per-interval, 3-row disaggregated cross-index JOIN counter to the runtime telemetry layer (the counter CARRIER). The increment hooks live downstream in softclient4es-arrow; the AC-5a disabled-tick reset in softclient4es-extensions.

Changes (licensing module)

  • TelemetryCollector.scala: JoinRow enum (Passthrough row 1 / CrossCluster row 2 / Coordinator row 3), 3 AtomicLong buckets, incrementJoin(JoinRow) (lock-free, mirrors incrementQueries), collectAndResetJoinCounts(): (Long, Map[String,Long]). collect reads .get() (no reset); collectAndReset reads .getAndSet(0L) (per-interval delta flush). TelemetryData += joinQueryCount (total) + joinQueryByRow (always all 3 keys, even 0). Noop overrides added.
  • Scaladoc: JOIN fields are per-interval DELTAS (reset each interval / shutdown flush), distinct from cumulative queriesTotal (left unchanged).
  • TelemetryCollectorSpec.scala: 8 new tests — 16/16 pass.

Key behaviours

  • joinQueryCount == passthrough + cross_cluster + coordinator on every collected snapshot.
  • No SQL text, no org/query IDs — integers only (AC 7).

Build

scalafmtAll; + licensing/compile + + core/compile clean (Scala 2.12.20 + 2.13.16). Published softclient4es-licensing + softclient4es-sql 0.20-SNAPSHOT locally for the downstream arrow build.

Sibling PRs (Epic 15 / Story 15.3)

  • softclient4es-extensions — AC-5a disabled-tick JOIN reset
  • softclient4es-arrow — sidecar/federation/REPL increment hooks + AC-5b shutdown flush

Draft — base release-r1. Story 15.2 stacks on this branch (feature/15.3) for the shared repos.

🤖 Generated with Claude Code

…lector (Story 15.3)

Adds a per-interval, 3-row cross-index JOIN counter to the runtime telemetry
layer so the Story-15.2 daily ping carries a join_query_count delta and the R1
dashboard (15.5) can measure JOIN workload — integers only, no PII.

- TelemetryCollector: JoinRow enum (Passthrough/CrossCluster/Coordinator),
  3 AtomicLong buckets, incrementJoin(JoinRow), collectAndResetJoinCounts()
  helper; collect() reads .get() (no reset), collectAndReset() reads
  .getAndSet(0L) (per-interval delta flush). Noop overrides added.
- TelemetryData: += joinQueryCount (total) + joinQueryByRow (always all 3 keys,
  even 0). joinQueryCount == passthrough + cross_cluster + coordinator. Per-
  interval DELTAS, distinct from the cumulative queriesTotal (left unchanged).
- 8 new TelemetryCollectorSpec tests (per-row, all-3-keys, no-reset-on-collect,
  reset-on-collectAndReset, collectAndResetJoinCounts, concurrency, no-PII, Noop).

Cross-compiles clean 2.12.20 + 2.13.16; 16/16 spec pass.

Closed Issue #110

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@fupelaqu fupelaqu marked this pull request as ready for review June 22, 2026 03:55
@fupelaqu fupelaqu merged commit ff56fa4 into release-r1 Jun 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant