src/MemoryTracing/MemoryTracingIntegrationTest.cpp
void VerifyEventCounts(const std::vector<ProducerCaptureEvent>& events, size_t expected_counts) {
  constexpr size_t kEventCountsErrorTolerance = 2;

  size_t num_received_events = 0;
  for (const auto& event : events) {
    if (event.event_case() == ProducerCaptureEvent::kMemoryUsageEvent) num_received_events++;
  }

  EXPECT_GE(num_received_events, expected_counts - kEventCountsErrorTolerance);
}
// Verify whether the memory_sampling_period_ns_ works as expected by checking the number of
// received events.
Verify whether the memory_sampling_period_ns_ works as expected by checking the number of
received events.
Verify whether the memory_sampling_period_ns_ works as expected by checking the number of received events .
void VerifyEventCounts(const std::vector<ProducerCaptureEvent>& events, size_t expected_counts) {
  constexpr size_t kEventCountsErrorTolerance = 2;
  size_t num_received_events = 0;
  for (const auto& event : events) {
    if (event.event_case() == ProducerCaptureEvent::kMemoryUsageEvent) num_received_events++;
  }
  EXPECT_GE(num_received_events, expected_counts - kEventCountsErrorTolerance);
}
void VerifyEventCounts ( const std :: vector < ProducerCaptureEvent > & events , size_t expected_counts ) { constexpr size_t kEventCountsErrorTolerance = 2 ; size_t num_received_events = 0 ; for ( const auto & event : events ) { if ( event . event_case ( ) == ProducerCaptureEvent :: kMemoryUsageEvent ) num_received_events ++ ; } EXPECT_GE ( num_received_events , expected_counts - kEventCountsErrorTolerance ) ; }
Verify whether the memory_sampling_period_ns_ works as expected by checking the number of
received events.
Verify whether the memory_sampling_period_ns_ works as expected by checking the number of received events .