Skip to content

Conversation

jmarantz
Copy link
Contributor

@jmarantz jmarantz commented May 20, 2019

Description: In some cases, a stat name string cannot be determined until requests are being processed. See #7003 for more details. In this case, we want to spend some memory for TLS cache infrastructure to allow conversion of that string to a StatName without taking a lock (after the first lookup). This PR provides StringStatNameMap and Scope::fastMemoryIntensiveStatNameLookup to try to solve this problem. The awkward wording of the lookup method is intended to discourage its use for stats where the name can be symbolized during construction. This should only be used when the name is based on tokens that are discoverable only at runtime, e.g. due to stat-name prefix from request headers.
Risk Level: medium
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Fixes: #7003

jmarantz added 5 commits May 19, 2019 21:58
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
jmarantz added 5 commits May 20, 2019 13:06
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@stale
Copy link

stale bot commented May 29, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label May 29, 2019
@jmarantz jmarantz requested a review from mattklein123 May 29, 2019 20:52
@stale stale bot removed the stale stalebot believes this issue/PR has not been touched recently label May 29, 2019
@jmarantz jmarantz marked this pull request as ready for review May 29, 2019 20:52
@jmarantz
Copy link
Contributor Author

Sorry -- I put this together a while back to get comments but I think I'll take it out of draft status.

I'm not sure if this is worth it -- seeking opinions.

I just came across another situation where I think we might need this GRPC methods get injected as a token into a stat-name, and IIUC these are arbitrary tokens, but in any given application there will only be a finite number of them. So having a lock-free way to get StatNames for those may be needed.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

🔨 rebuilding ci/circleci: compile_time_options (failed build)

🐱

Caused by: a #7008 (comment) was created by @jmarantz.

see: more, trace.

@mattklein123 mattklein123 self-assigned this May 31, 2019
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

@jmarantz this is very cool, but my opinion is that we should put this on ice until we see perf traces that make us think we should do this. I'm hesitant to make the stat code more complicated than it needs to be. WDYT?

/wait-any

@jmarantz
Copy link
Contributor Author

agreed. this adds complexity without explicit evidence its needed. But I think we might get it when I convert the gRPC stats to use StatName. Let's hold off on this till that review is ready to go (still working on it but haven't had time this week to make progress).

@jmarantz jmarantz added no stalebot Disables stalebot from closing an issue waiting:any labels May 31, 2019
@mattklein123 mattklein123 removed no stalebot Disables stalebot from closing an issue labels Jun 18, 2019
@stale
Copy link

stale bot commented Jun 25, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Jun 25, 2019
@stale
Copy link

stale bot commented Jul 3, 2019

This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale stalebot believes this issue/PR has not been touched recently waiting:any
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stats: need a way to lookup stats from strings in hot-path without taking a lock.
2 participants