comparison OrthancServer/OrthancRestApi/OrthancRestApi.cpp @ 3175:574890d14c92

new metrics: orthanc_store_dicom_duration_ms, orthanc_storage_[create|read|remove]_duration_ms
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 29 Jan 2019 17:34:09 +0100
parents 4e43e67f8ecf
children 784bbb03fb54
comparison
equal deleted inserted replaced
3174:8ea7c4546c3a 3175:574890d14c92
33 33
34 #include "../PrecompiledHeadersServer.h" 34 #include "../PrecompiledHeadersServer.h"
35 #include "OrthancRestApi.h" 35 #include "OrthancRestApi.h"
36 36
37 #include "../../Core/Logging.h" 37 #include "../../Core/Logging.h"
38 #include "../../Core/MetricsRegistry.h"
38 #include "../../Core/SerializationToolbox.h" 39 #include "../../Core/SerializationToolbox.h"
39 #include "../ServerContext.h" 40 #include "../ServerContext.h"
40 41
41 namespace Orthanc 42 namespace Orthanc
42 { 43 {
151 // Auto-generated directories 152 // Auto-generated directories
152 Register("/tools", RestApi::AutoListChildren); 153 Register("/tools", RestApi::AutoListChildren);
153 Register("/tools/reset", ResetOrthanc); 154 Register("/tools/reset", ResetOrthanc);
154 Register("/tools/shutdown", ShutdownOrthanc); 155 Register("/tools/shutdown", ShutdownOrthanc);
155 Register("/instances/{id}/frames/{frame}", RestApi::AutoListChildren); 156 Register("/instances/{id}/frames/{frame}", RestApi::AutoListChildren);
157 }
158
159
160 bool OrthancRestApi::Handle(HttpOutput& output,
161 RequestOrigin origin,
162 const char* remoteIp,
163 const char* username,
164 HttpMethod method,
165 const UriComponents& uri,
166 const Arguments& headers,
167 const GetArguments& getArguments,
168 const char* bodyData,
169 size_t bodySize)
170 {
171 MetricsRegistry::Timer timer(context_.GetMetricsRegistry(), "orthanc_rest_api_duration_ms");
172
173 return RestApi::Handle(output, origin, remoteIp, username, method,
174 uri, headers, getArguments, bodyData, bodySize);
156 } 175 }
157 176
158 177
159 ServerContext& OrthancRestApi::GetContext(RestApiCall& call) 178 ServerContext& OrthancRestApi::GetContext(RestApiCall& call)
160 { 179 {