Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1080)

Unified Diff: base/debug/trace_event_impl.cc

Issue 717083003: Report trace buffer usage as number of events, not only percentage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/debug/trace_event_impl.cc
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc
index ce62766da3df551884d487c2ea5f914a22f9d18a..45a4fea5f4ff833633d240446d8ac619676d88f8 100644
--- a/base/debug/trace_event_impl.cc
+++ b/base/debug/trace_event_impl.cc
@@ -1586,10 +1586,12 @@ bool TraceLog::HasEnabledStateObserver(EnabledStateObserver* listener) const {
return it != enabled_state_observer_list_.end();
}
-float TraceLog::GetBufferPercentFull() const {
+TraceLog::BufferUsage TraceLog::GetBufferUsage() const {
AutoLock lock(lock_);
- return static_cast<float>(static_cast<double>(logged_events_->Size()) /
- logged_events_->Capacity());
+ BufferUsage result;
+ result.event_capacity = logged_events_->Capacity();
+ result.event_count = logged_events_->Size();
+ return result;
}
bool TraceLog::BufferIsFull() const {

Powered by Google App Engine
This is Rietveld 408576698