diff OrthancServer/Plugins/Engine/PluginsEnumerations.cpp @ 5326:fbe857e942cd

store metrics as integers instead of floats to avoid precision loss in increments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 25 Jun 2023 18:28:49 +0200
parents 0ea402b4d901
children dd9795dc380d
line wrap: on
line diff
--- a/OrthancServer/Plugins/Engine/PluginsEnumerations.cpp	Sun Jun 25 17:49:34 2023 +0200
+++ b/OrthancServer/Plugins/Engine/PluginsEnumerations.cpp	Sun Jun 25 18:28:49 2023 +0200
@@ -578,5 +578,21 @@
           throw OrthancException(ErrorCode_ParameterOutOfRange);
       }
     }
+
+
+    MetricsType Convert(OrthancPluginMetricsType type)
+    {
+      switch (type)
+      {
+        case OrthancPluginMetricsType_Default:
+          return MetricsType_Default;
+
+        case OrthancPluginMetricsType_Timer:
+          return MetricsType_MaxOver10Seconds;
+
+        default:
+          throw OrthancException(ErrorCode_ParameterOutOfRange);
+      }
+    }
   }
 }