Merge "[Sensors MH2] Keep track of most events seen on pending queue" am: b2e4c01a76
am: ec3f43a767
Change-Id: Id6e6cf1bda80cd79a5f83c0dec252e78e3f3d4e1
This commit is contained in:
commit
dd2b347ca0
2 changed files with 7 additions and 0 deletions
|
@ -290,6 +290,8 @@ Return<void> HalProxy::debug(const hidl_handle& fd, const hidl_vec<hidl_string>&
|
|||
stream << " Wakelock ref count: " << mWakelockRefCount << std::endl;
|
||||
stream << " # of events on pending write writes queue: " << mSizePendingWriteEventsQueue
|
||||
<< std::endl;
|
||||
stream << " Most events seen on pending write events queue: "
|
||||
<< mMostEventsObservedPendingWriteEventsQueue << std::endl;
|
||||
if (!mPendingWriteEventsQueue.empty()) {
|
||||
stream << " Size of events list on front of pending writes queue: "
|
||||
<< mPendingWriteEventsQueue.front().first.size() << std::endl;
|
||||
|
@ -571,6 +573,8 @@ void HalProxy::postEventsToMessageQueue(const std::vector<Event>& events, size_t
|
|||
std::vector<Event> eventsLeft(events.begin() + numToWrite, events.end());
|
||||
mPendingWriteEventsQueue.push({eventsLeft, numWakeupEvents});
|
||||
mSizePendingWriteEventsQueue += numLeft;
|
||||
mMostEventsObservedPendingWriteEventsQueue =
|
||||
std::max(mMostEventsObservedPendingWriteEventsQueue, mSizePendingWriteEventsQueue);
|
||||
mEventQueueWriteCV.notify_one();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,6 +200,9 @@ class HalProxy : public ISensors, public IScopedWakelockRefCounter {
|
|||
*/
|
||||
std::queue<std::pair<std::vector<Event>, size_t>> mPendingWriteEventsQueue;
|
||||
|
||||
//! The most events observed on the pending write events queue for debug purposes.
|
||||
size_t mMostEventsObservedPendingWriteEventsQueue = 0;
|
||||
|
||||
//! The max number of events allowed in the pending write events queue
|
||||
static constexpr size_t kMaxSizePendingWriteEventsQueue = 100000;
|
||||
|
||||
|
|
Loading…
Reference in a new issue