-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
stats: minor review comments #3279
Changes from all commits
b77ab11
77f43f9
ea46d71
2866d9c
89a754e
7a1706d
743ec5d
af97e6f
165a4a3
2cec102
b4bc633
72730c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,8 +101,9 @@ void ThreadLocalStoreImpl::mergeHistograms(PostMergeCb merge_complete_cb) { | |
merge_in_progress_ = true; | ||
tls_->runOnAllThreads( | ||
[this]() -> void { | ||
for (const auto& scopes : tls_->getTyped<TlsCache>().scope_cache_) { | ||
for (const auto& name_histogram_pair : scopes.second.histograms_) { | ||
for (const auto& scope : tls_->getTyped<TlsCache>().scope_cache_) { | ||
const TlsCacheEntry& tls_cache_entry = scope.second; | ||
for (const auto& name_histogram_pair : tls_cache_entry.histograms_) { | ||
const TlsHistogramSharedPtr& tls_hist = name_histogram_pair.second; | ||
tls_hist->beginMerge(); | ||
} | ||
|
@@ -135,7 +136,8 @@ void ThreadLocalStoreImpl::releaseScopeCrossThread(ScopeImpl* scope) { | |
} | ||
} | ||
|
||
std::string ThreadLocalStoreImpl::getTagsForName(const std::string& name, std::vector<Tag>& tags) { | ||
std::string ThreadLocalStoreImpl::getTagsForName(const std::string& name, | ||
std::vector<Tag>& tags) const { | ||
return tag_producer_->produceTags(name, tags); | ||
} | ||
|
||
|
@@ -297,7 +299,6 @@ Histogram& ThreadLocalStoreImpl::ScopeImpl::tlsHistogram(const std::string& name | |
return **tls_ref; | ||
} | ||
|
||
std::unique_lock<std::mutex> lock(parent_.lock_); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have removed the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reverted this check as this test case https://github.com/envoyproxy/envoy/blob/master/test/common/stats/thread_local_store_test.cc#L208 fails. Do we need this test at all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is better to merge this PR if we are good with metrics service test changes since it removes the flakiness and can do another PR for this parent_tls_ null check and think about creating TLS histogram in shutdown case. |
||
std::vector<Tag> tags; | ||
std::string tag_extracted_name = parent_.getTagsForName(name, tags); | ||
TlsHistogramSharedPtr hist_tls_ptr = std::make_shared<ThreadLocalHistogramImpl>( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whitespace change makes me think you are running the format-fixing script with the clang setup on your machine rather than via docker. In particular it re-wrapped the line to fit in 80 columns when Envoy standard is 100. You probably want to run the format-fixer like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it is because of const addition the length went up to 106 that is why it wrapped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. I stared at that for 1 less second than needed & missed the 'const' addition :)