comparison 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
comparison
equal deleted inserted replaced
114:fbdef0562717 116:569e17419eae
19 **/ 19 **/
20 20
21 21
22 #include "DatabaseManager.h" 22 #include "DatabaseManager.h"
23 23
24 #include <Plugins/Samples/Common/OrthancPluginCppWrapper.h>
25
24 #include <Core/Logging.h> 26 #include <Core/Logging.h>
25 #include <Core/OrthancException.h> 27 #include <Core/OrthancException.h>
26 28
27 #include <boost/thread.hpp> 29 #include <boost/thread.hpp>
28 30
508 assert(statement_ == NULL); 510 assert(statement_ == NULL);
509 statement_ = &GetManager().CacheStatement(location_, *query); 511 statement_ = &GetManager().CacheStatement(location_, *query);
510 } 512 }
511 513
512 assert(statement_ != NULL); 514 assert(statement_ != NULL);
515
516 /*
517 TODO - Sample code to monitor the execution time of each
518 cached statement, and publish it as an Orthanc metrics
519
520 #if HAS_ORTHANC_PLUGIN_METRICS == 1
521 std::string name = (std::string(location_.GetFile()) + "_" +
522 boost::lexical_cast<std::string>(location_.GetLine()));
523 OrthancPlugins::MetricsTimer timer(name.c_str());
524 #endif
525 */
526
513 SetResult(GetTransaction().Execute(*statement_, parameters)); 527 SetResult(GetTransaction().Execute(*statement_, parameters));
514 } 528 }
515 catch (Orthanc::OrthancException& e) 529 catch (Orthanc::OrthancException& e)
516 { 530 {
517 GetManager().CloseIfUnavailable(e.GetErrorCode()); 531 GetManager().CloseIfUnavailable(e.GetErrorCode());