nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #721: MINIFICPP-1135 - Add a watchdog to schedulingAgent to warn in case of…
Date Thu, 30 Jan 2020 17:03:43 GMT
szaszm commented on a change in pull request #721: MINIFICPP-1135 - Add a watchdog to schedulingAgent
to warn in case of…
URL: https://github.com/apache/nifi-minifi-cpp/pull/721#discussion_r373065433
 
 

 ##########
 File path: libminifi/include/SchedulingAgent.h
 ##########
 @@ -190,8 +201,28 @@ class SchedulingAgent {
   std::shared_ptr<core::controller::ControllerServiceProvider> controller_service_provider_;
 
  private:
+  struct SchedulingInfo {
+    std::chrono::time_point<std::chrono::steady_clock> start_time_;
+    std::string name_;
+    std::string uuid_;
+
+    SchedulingInfo(const std::shared_ptr<core::Processor> &processor) {
+     start_time_ = std::chrono::steady_clock::now();
+     name_ = processor->getName();
+     uuid_ = processor->getUUIDStr();
 
 Review comment:
   Prefer initialization to assignment in constructors. In most cases, including here with
`start_time_`, I prefer default member initializers a.k.a. in-class initializers.
   
   https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c49-prefer-initialization-to-assignment-in-constructors
   https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rc-in-class-initializer

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message