diff Framework/Common/DatabaseManager.cpp @ 116:569e17419eae OrthancMySQL-2.0

test metrics
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Jan 2019 17:05:49 +0100
parents e6c13ddd26d9
children 260fc55f10cd 4cd7e45b671e
line wrap: on
line diff
--- a/Framework/Common/DatabaseManager.cpp	Wed Jan 23 20:14:24 2019 +0100
+++ b/Framework/Common/DatabaseManager.cpp	Wed Jan 30 17:05:49 2019 +0100
@@ -21,6 +21,8 @@
 
 #include "DatabaseManager.h"
 
+#include <Plugins/Samples/Common/OrthancPluginCppWrapper.h>
+
 #include <Core/Logging.h>
 #include <Core/OrthancException.h>
 
@@ -510,6 +512,18 @@
       }
         
       assert(statement_ != NULL);
+
+      /*
+        TODO - Sample code to monitor the execution time of each
+        cached statement, and publish it as an Orthanc metrics
+
+        #if HAS_ORTHANC_PLUGIN_METRICS == 1
+        std::string name = (std::string(location_.GetFile()) + "_" +
+        boost::lexical_cast<std::string>(location_.GetLine()));
+        OrthancPlugins::MetricsTimer timer(name.c_str());
+        #endif
+      */
+
       SetResult(GetTransaction().Execute(*statement_, parameters));
     }
     catch (Orthanc::OrthancException& e)