diff 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
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/IDatabaseWrapper.h	Wed Jan 10 15:26:10 2024 +0100
+++ b/OrthancServer/Sources/Database/IDatabaseWrapper.h	Mon Jan 15 18:25:08 2024 +0100
@@ -57,18 +57,21 @@
       bool hasLabelsSupport_;
       bool hasAtomicIncrementGlobalProperty_;
       bool hasUpdateAndGetStatistics_;
+      bool hasMeasureLatency_;
 
     public:
       Capabilities(bool hasFlushToDisk,
                    bool hasRevisionsSupport,
                    bool hasLabelsSupport,
                    bool hasAtomicIncrementGlobalProperty,
-                   bool hasUpdateAndGetStatistics)
+                   bool hasUpdateAndGetStatistics,
+                   bool hasMeasureLatency)
       : hasFlushToDisk_(hasFlushToDisk),
         hasRevisionsSupport_(hasRevisionsSupport),
         hasLabelsSupport_(hasLabelsSupport),
         hasAtomicIncrementGlobalProperty_(hasAtomicIncrementGlobalProperty),
-        hasUpdateAndGetStatistics_(hasUpdateAndGetStatistics)
+        hasUpdateAndGetStatistics_(hasUpdateAndGetStatistics),
+        hasMeasureLatency_(hasMeasureLatency)
       {
       }
 
@@ -97,6 +100,11 @@
         return hasUpdateAndGetStatistics_;
       }
 
+      bool HasMeasureLatency() const
+      {
+        return hasMeasureLatency_;
+      }
+
     };
 
     struct CreateInstanceResult : public boost::noncopyable
@@ -348,5 +356,7 @@
                          IStorageArea& storageArea) = 0;
 
     virtual const IDatabaseWrapper::Capabilities& GetDatabaseCapabilities() const = 0;
+
+    virtual uint64_t MeasureLatency() = 0;
   };
 }