Skip to content

Capture per-entity metrics on Repository and EventStore#155

Open
stefanmirkovic wants to merge 3 commits into
feature/af5-model-inspectionfrom
feature/entity-metrics-capture
Open

Capture per-entity metrics on Repository and EventStore#155
stefanmirkovic wants to merge 3 commits into
feature/af5-model-inspectionfrom
feature/entity-metrics-capture

Conversation

@stefanmirkovic
Copy link
Copy Markdown
Contributor

@stefanmirkovic stefanmirkovic commented May 22, 2026

Adds EntityMetricsRegistry that aggregates load rate, creation rate, total load time, event commit time, event stream size, and event criteria size per entity load identifier, shipped on every StatisticReport. A repository decorator records load and loadOrCreate timings and only registers a creation when the event store sourced zero events - so redeem/update commands on existing entities aren't double-counted as creations. An event-store decorator attributes commit time, stream size, and criteria size to the active entity via CurrentEntityContext and a shared AtomicLong that the streaming wrapper bumps for each sourced event. Count-style timers use higher percentile precision and skip recording zero so the Inspector UI shows clean integer counts instead of 0.98 / 0.99 bucket artifacts.

Relates: https://github.com/AxonIQ/axoniq-platform/pull/644

@stefanmirkovic stefanmirkovic self-assigned this May 22, 2026
@stefanmirkovic stefanmirkovic added the Backend This issue contains backend changes label May 22, 2026
@stefanmirkovic stefanmirkovic changed the base branch from main to feature/af5-model-inspection May 22, 2026 12:10
CodeDrivenMitch and others added 2 commits May 22, 2026 15:48
EntityMetricsRegistry shipped on each StatisticReport. Repository decorator
records load timings; event-store decorator attributes commit time, stream size
and criteria size via CurrentEntityContext on the ProcessingContext. Count
timers use higher precision and skip recording zero.
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@CodeDrivenMitch CodeDrivenMitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. However, check and update the copyright headers before merging!

@@ -0,0 +1,24 @@
/*
* Copyright (c) 2022-2025. AxonIQ B.V.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright notice is outdated. Should be 2026. Are you using the copyright plugin with the templte?

@@ -0,0 +1,30 @@
/*
* Copyright (c) 2022-2025. AxonIQ B.V.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, copyright issue

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the entire PR before merging

Copy link
Copy Markdown
Collaborator

@CodeDrivenMitch CodeDrivenMitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comment on the backend PR about metric identifier conventions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend This issue contains backend changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants