comparison OrthancServer/ServerContext.cpp @ 3174:8ea7c4546c3a

primitives to collect metrics in Orthanc
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 29 Jan 2019 15:15:48 +0100
parents 1fe524e211af
children 574890d14c92
comparison
equal deleted inserted replaced
3173:096f4a29f223 3174:8ea7c4546c3a
39 #include "../Core/FileStorage/StorageAccessor.h" 39 #include "../Core/FileStorage/StorageAccessor.h"
40 #include "../Core/HttpServer/FilesystemHttpSender.h" 40 #include "../Core/HttpServer/FilesystemHttpSender.h"
41 #include "../Core/HttpServer/HttpStreamTranscoder.h" 41 #include "../Core/HttpServer/HttpStreamTranscoder.h"
42 #include "../Core/JobsEngine/SetOfInstancesJob.h" 42 #include "../Core/JobsEngine/SetOfInstancesJob.h"
43 #include "../Core/Logging.h" 43 #include "../Core/Logging.h"
44 #include "../Core/MetricsRegistry.h"
44 #include "../Plugins/Engine/OrthancPlugins.h" 45 #include "../Plugins/Engine/OrthancPlugins.h"
45 46
46 #include "OrthancConfiguration.h" 47 #include "OrthancConfiguration.h"
47 #include "OrthancRestApi/OrthancRestApi.h" 48 #include "OrthancRestApi/OrthancRestApi.h"
48 #include "Search/DatabaseLookup.h" 49 #include "Search/DatabaseLookup.h"
235 #if ORTHANC_ENABLE_PLUGINS == 1 236 #if ORTHANC_ENABLE_PLUGINS == 1
236 plugins_(NULL), 237 plugins_(NULL),
237 #endif 238 #endif
238 done_(false), 239 done_(false),
239 haveJobsChanged_(false), 240 haveJobsChanged_(false),
240 isJobsEngineUnserialized_(false) 241 isJobsEngineUnserialized_(false),
242 metricsRegistry_(new MetricsRegistry)
241 { 243 {
242 { 244 {
243 OrthancConfiguration::ReaderLock lock; 245 OrthancConfiguration::ReaderLock lock;
244 246
245 queryRetrieveArchive_.reset( 247 queryRetrieveArchive_.reset(
247 mediaArchive_.reset( 249 mediaArchive_.reset(
248 new SharedArchive(lock.GetConfiguration().GetUnsignedIntegerParameter("MediaArchiveSize", 1))); 250 new SharedArchive(lock.GetConfiguration().GetUnsignedIntegerParameter("MediaArchiveSize", 1)));
249 defaultLocalAet_ = lock.GetConfiguration().GetStringParameter("DicomAet", "ORTHANC"); 251 defaultLocalAet_ = lock.GetConfiguration().GetStringParameter("DicomAet", "ORTHANC");
250 jobsEngine_.SetWorkersCount(lock.GetConfiguration().GetUnsignedIntegerParameter("ConcurrentJobs", 2)); 252 jobsEngine_.SetWorkersCount(lock.GetConfiguration().GetUnsignedIntegerParameter("ConcurrentJobs", 2));
251 saveJobs_ = lock.GetConfiguration().GetBooleanParameter("SaveJobs", true); 253 saveJobs_ = lock.GetConfiguration().GetBooleanParameter("SaveJobs", true);
254 metricsRegistry_->SetEnabled(lock.GetConfiguration().GetBooleanParameter("MetricsEnabled", true));
252 } 255 }
253 256
254 jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200); 257 jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200);
255 258
256 listeners_.push_back(ServerListener(luaListener_, "Lua")); 259 listeners_.push_back(ServerListener(luaListener_, "Lua"));