comparison OrthancServer/Sources/Database/IDatabaseWrapper.h @ 5493:b3ebe249ed5b pg-transactions

At startup, when using a database plugin, display the latency to access the DB
author Alain Mazy <am@osimis.io>
date Mon, 15 Jan 2024 18:25:08 +0100
parents dceed5e3d6a9
children 4dd50c4b985a
comparison
equal deleted inserted replaced
5492:26877f4b306f 5493:b3ebe249ed5b
55 bool hasFlushToDisk_; 55 bool hasFlushToDisk_;
56 bool hasRevisionsSupport_; 56 bool hasRevisionsSupport_;
57 bool hasLabelsSupport_; 57 bool hasLabelsSupport_;
58 bool hasAtomicIncrementGlobalProperty_; 58 bool hasAtomicIncrementGlobalProperty_;
59 bool hasUpdateAndGetStatistics_; 59 bool hasUpdateAndGetStatistics_;
60 bool hasMeasureLatency_;
60 61
61 public: 62 public:
62 Capabilities(bool hasFlushToDisk, 63 Capabilities(bool hasFlushToDisk,
63 bool hasRevisionsSupport, 64 bool hasRevisionsSupport,
64 bool hasLabelsSupport, 65 bool hasLabelsSupport,
65 bool hasAtomicIncrementGlobalProperty, 66 bool hasAtomicIncrementGlobalProperty,
66 bool hasUpdateAndGetStatistics) 67 bool hasUpdateAndGetStatistics,
68 bool hasMeasureLatency)
67 : hasFlushToDisk_(hasFlushToDisk), 69 : hasFlushToDisk_(hasFlushToDisk),
68 hasRevisionsSupport_(hasRevisionsSupport), 70 hasRevisionsSupport_(hasRevisionsSupport),
69 hasLabelsSupport_(hasLabelsSupport), 71 hasLabelsSupport_(hasLabelsSupport),
70 hasAtomicIncrementGlobalProperty_(hasAtomicIncrementGlobalProperty), 72 hasAtomicIncrementGlobalProperty_(hasAtomicIncrementGlobalProperty),
71 hasUpdateAndGetStatistics_(hasUpdateAndGetStatistics) 73 hasUpdateAndGetStatistics_(hasUpdateAndGetStatistics),
74 hasMeasureLatency_(hasMeasureLatency)
72 { 75 {
73 } 76 }
74 77
75 bool HasFlushToDisk() const 78 bool HasFlushToDisk() const
76 { 79 {
93 } 96 }
94 97
95 bool HasUpdateAndGetStatistics() const 98 bool HasUpdateAndGetStatistics() const
96 { 99 {
97 return hasUpdateAndGetStatistics_; 100 return hasUpdateAndGetStatistics_;
101 }
102
103 bool HasMeasureLatency() const
104 {
105 return hasMeasureLatency_;
98 } 106 }
99 107
100 }; 108 };
101 109
102 struct CreateInstanceResult : public boost::noncopyable 110 struct CreateInstanceResult : public boost::noncopyable
346 354
347 virtual void Upgrade(unsigned int targetVersion, 355 virtual void Upgrade(unsigned int targetVersion,
348 IStorageArea& storageArea) = 0; 356 IStorageArea& storageArea) = 0;
349 357
350 virtual const IDatabaseWrapper::Capabilities& GetDatabaseCapabilities() const = 0; 358 virtual const IDatabaseWrapper::Capabilities& GetDatabaseCapabilities() const = 0;
359
360 virtual uint64_t MeasureLatency() = 0;
351 }; 361 };
352 } 362 }