Skip to content

Fix memory pool metrics unit to follow standard #62766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 19, 2025

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Jul 17, 2025

The Unified Code for Units of Measure (UCUM) standard for bytes is By and should be the unit here.

Edit: Also renamed counters

@JamesNK JamesNK requested review from BrennanConroy and Copilot July 17, 2025 07:07
@JamesNK JamesNK added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jul 17, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR standardizes the memory pool metrics units to follow the Unified Code for Units of Measure (UCUM) standard by changing the unit specification from "{bytes}" to "By" for all byte-related metrics.

  • Updates unit specifications for four memory pool metrics to use UCUM standard notation
  • Ensures consistency with standard units of measure for telemetry data

@@ -23,22 +23,22 @@ public PinnedBlockMemoryPoolMetrics(IMeterFactory meterFactory)

_currentMemory = _meter.CreateUpDownCounter<long>(
"aspnetcore.memorypool.current_memory",
Copy link
Member Author

Choose a reason for hiding this comment

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

Should the name be aspnetcore.memory_pool.current_memory? Memory pool is two words so should be seperated by an underscore.

Copy link
Member

Choose a reason for hiding this comment

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

I'd stick to memorypool as it's a common term (even when it consists of multiple words).
Otherwise the same could apply to aspnet_core (or asp_net_core), etc.

From a usability point when searching through metrics with memory_ one can find quite a lot.
So when I'm interested in the memory pool, I'd search for memorypool as I won't remember that it's separated by underscore.

Copy link
Member Author

Choose a reason for hiding this comment

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

We have rate_limiting rather than ratelimiting in other metrics. So an underscore here would be consistant with that.

To go with the standard, and consistency, I think memory_pool is better.

Otherwise the same could apply to aspnet_core (or asp_net_core), etc.

All product names in metrics seem to avoid underscores, e.g. cloudfoundary, elasticsearch, openai, etc.

@JamesNK JamesNK merged commit b9f43c1 into main Jul 19, 2025
28 checks passed
@JamesNK JamesNK deleted the jamesnk/memorypool-metrics-unit branch July 19, 2025 05:48
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview7 milestone Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy