bakaid commented on a change in pull request #741: MINIFICPP-1139 Implemented.
URL: https://github.com/apache/nifi-minifi-cpp/pull/741#discussion_r385160801
 
 

 ##########
 File path: extensions/windows-event-log/ConsumeWindowsEventLog.cpp
 ##########
 @@ -271,19 +279,84 @@ void ConsumeWindowsEventLog::onTrigger(const 
std::shared_ptr<core::ProcessContex
     return;
   }
 
-  const auto flowFileCount = processQueue(session);
+  const auto commitAndSaveBookmark = [&] (const std::wstring& bookmarkXml){
+    const auto before_commit = std::chrono::high_resolution_clock::now();
+    session->commit();
+    logger_->log_debug("processQueue commit took %llu ms",
+      
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now()
 - before_commit).count());
+
+    pBookmark_->saveBookmarkXml(bookmarkXml);
+
+    if (session->outgoingConnectionsFull("success")) {
+      return false;
+    }
+
+    return true;
+  };
 
-  const auto now = GetTickCount64();
+  size_t eventCount = 0;
+  const auto before_time = std::chrono::high_resolution_clock::now();
+  utils::ScopeGuard timeGuard([&]() {
+    logger_->log_debug("processed %d Events in %llu ms",
+                       eventCount,
+                       
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now()
 - before_time).count());
 
 Review comment:
   @am-c-p-p you have to changed this single instance from 
`high_resolution_clock` to `steady_clock`. Subtracting a time point created 
with one type clock from a time point created by an another is a very bad idea.
   Please change *all* instances of `high_resolution_clock` to `steady_clock`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to