Mercurial > hg > orthanc
comparison OrthancServer/Sources/ServerContext.cpp @ 5111:7547c7dfd017
/tools/metrics-prometheus: added orthanc_last_change and orthanc_up_time_s
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 22 Nov 2022 18:01:23 +0100 |
parents | e69a3ff39bc5 |
children | 19ccae2e0371 |
comparison
equal
deleted
inserted
replaced
5110:98da039474b1 | 5111:7547c7dfd017 |
---|---|
311 dcmtkTranscoder_(new DcmtkTranscoder), | 311 dcmtkTranscoder_(new DcmtkTranscoder), |
312 isIngestTranscoding_(false), | 312 isIngestTranscoding_(false), |
313 ingestTranscodingOfUncompressed_(true), | 313 ingestTranscodingOfUncompressed_(true), |
314 ingestTranscodingOfCompressed_(true), | 314 ingestTranscodingOfCompressed_(true), |
315 preferredTransferSyntax_(DicomTransferSyntax_LittleEndianExplicit), | 315 preferredTransferSyntax_(DicomTransferSyntax_LittleEndianExplicit), |
316 deidentifyLogs_(false) | 316 deidentifyLogs_(false), |
317 serverStartTimeUtc_(boost::posix_time::second_clock::universal_time()) | |
317 { | 318 { |
318 try | 319 try |
319 { | 320 { |
320 unsigned int lossyQuality; | 321 unsigned int lossyQuality; |
321 | 322 |
2488 } | 2489 } |
2489 | 2490 |
2490 return true; | 2491 return true; |
2491 } | 2492 } |
2492 | 2493 |
2494 int64_t ServerContext::GetServerUpTime() const | |
2495 { | |
2496 boost::posix_time::ptime nowUtc = boost::posix_time::second_clock::universal_time(); | |
2497 boost::posix_time::time_duration elapsed = nowUtc - serverStartTimeUtc_; | |
2498 | |
2499 return elapsed.total_seconds(); | |
2500 } | |
2501 | |
2493 } | 2502 } |