Skip to content

Improve metrics#1176

Merged
edwinyyyu merged 2 commits into
MemMachine:mainfrom
edwinyyyu:improve_metrics
Mar 4, 2026
Merged

Improve metrics#1176
edwinyyyu merged 2 commits into
MemMachine:mainfrom
edwinyyyu:improve_metrics

Conversation

@edwinyyyu

@edwinyyyu edwinyyyu commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Purpose of the change

  • Reduce verbosity for implementations and make logic easier to get right for common latency metric.
  • Change latency to use histogram instead of summary.
  • Remove calls counter because latency metric already keeps track of number of observations.

Description

Remove user metrics labels because it is not necessary for any consumers and the application should not need to worry about topology.

Remove hundreds of lines of verbose boilerplate.

Makes implementation of future integrations easier.

Explored alternative of trying to use a decorator but then it's not clean to pass the correct metrics factory to the decorator.

Type of change

Breaks using user_metrics_labels. Also, metrics labels/names have changed.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g., code style improvements, linting)
  • Documentation update
  • Project Maintenance (updates to build scripts, CI, etc., that do not affect the main project)
  • Security (improves security without changing functionality)

How Has This Been Tested?

Manually tested telling Claude Code to use a script to get metrics.
demo_metrics.py

  • Unit Test
  • Integration Test
  • End-to-end Test
  • Test Script (please provide)
  • Manual verification (list step-by-step instructions)

Checklist

  • I have signed the commit(s) within this pull request
  • My code follows the style guidelines of this project (See STYLE_GUIDE.md)
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • Confirmed all checks passed
  • Contributor has signed the commit(s)
  • Reviewed the code
  • Run, Tested, and Verified the change(s) work as expected

@edwinyyyu edwinyyyu force-pushed the improve_metrics branch 2 times, most recently from dcc9c5e to f41f072 Compare March 4, 2026 21:19
@edwinyyyu

Copy link
Copy Markdown
Contributor Author

Mostly indentation changes -- recommend a different diff viewer

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>

Update with new filtering

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>

Fix uv.lock

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>

Rename space to distance

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>

Checkpoint update

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>

Weird vibes

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>

Checkpoint

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>

Remove user metrics labels

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>

Improve metrics collection

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>

Remove Chroma

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
@edwinyyyu edwinyyyu requested a review from svetly-todorov March 4, 2026 22:11
@edwinyyyu edwinyyyu mentioned this pull request Mar 4, 2026
26 tasks
@edwinyyyu edwinyyyu merged commit 58b7d12 into MemMachine:main Mar 4, 2026
44 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.

3 participants