changeset 6886:ee907f0d911b streaming

added logs
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 01 Jun 2026 18:02:56 +0200
parents 276aa95f145a
children ff10a9364ad7
files OrthancFramework/Sources/DataSource/DicomDataSource.cpp OrthancFramework/Sources/DataSource/TranscoderDataSource.cpp OrthancServer/Sources/ServerContext.cpp
diffstat 3 files changed, 44 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DataSource/DicomDataSource.cpp	Mon Jun 01 17:04:06 2026 +0200
+++ b/OrthancFramework/Sources/DataSource/DicomDataSource.cpp	Mon Jun 01 18:02:56 2026 +0200
@@ -26,6 +26,7 @@
 #include "DicomDataSource.h"
 
 #include "../DicomParsing/ParsedDicomFile.h"
+#include "../Logging.h"
 #include "../OrthancException.h"
 #include "BaseDataIdentifier.h"
 #include "DataSourceReader.h"
@@ -40,6 +41,10 @@
   {
   public:
     virtual StorageAreaDataSource::Range* ReadRange(DataSourceReader& reader) const = 0;
+
+    virtual const FileInfo& GetAttachment() const = 0;
+
+    virtual bool IsUntilPixelData() const = 0;
   };
 
 
@@ -72,6 +77,16 @@
       return StorageAreaDataSource::Execute(
         reader, StorageAreaDataSource::CreateAttachmentRequest(attachment_, true /* uncompress */));
     }
+
+    virtual const FileInfo& GetAttachment() const ORTHANC_OVERRIDE
+    {
+      return attachment_;
+    }
+
+    virtual bool IsUntilPixelData() const ORTHANC_OVERRIDE
+    {
+      return false;
+    }
   };
 
 
@@ -109,6 +124,16 @@
     {
       return StorageAreaDataSource::Execute(reader, StorageAreaDataSource::CreateBeginningRequest(attachment_, pixelDataOffset_));
     }
+
+    virtual const FileInfo& GetAttachment() const ORTHANC_OVERRIDE
+    {
+      return attachment_;
+    }
+
+    virtual bool IsUntilPixelData() const ORTHANC_OVERRIDE
+    {
+      return true;
+    }
   };
 
 
@@ -176,6 +201,9 @@
       }
     }
 
+    LOG(INFO) << "Parsing DICOM attachment"
+              << (id.IsUntilPixelData() ? " (until pixel data): " : ": ")
+              << id.GetAttachment().GetUuid();
     std::unique_ptr<Value> value(new Value(new ParsedDicomFile(range->GetData(), size), size));
     assert(GetValueSize(*value) == size);
 
--- a/OrthancFramework/Sources/DataSource/TranscoderDataSource.cpp	Mon Jun 01 17:04:06 2026 +0200
+++ b/OrthancFramework/Sources/DataSource/TranscoderDataSource.cpp	Mon Jun 01 18:02:56 2026 +0200
@@ -25,6 +25,7 @@
 #include "TranscoderDataSource.h"
 
 #include "../DicomParsing/ParsedDicomFile.h"
+#include "../Logging.h"
 #include "../OrthancException.h"
 #include "BaseDataIdentifier.h"
 #include "DataSourceReader.h"
@@ -207,6 +208,8 @@
       std::set<DicomTransferSyntax> allowedSyntaxes;
       allowedSyntaxes.insert(targetSyntax_);
 
+      LOG(INFO) << "Transcoding DICOM attachment to " << GetTransferSyntaxUid(targetSyntax_) << ": " << attachment_.GetUuid();
+
       bool success;
       if (hasLossyQuality_)
       {
--- a/OrthancServer/Sources/ServerContext.cpp	Mon Jun 01 17:04:06 2026 +0200
+++ b/OrthancServer/Sources/ServerContext.cpp	Mon Jun 01 18:02:56 2026 +0200
@@ -584,10 +584,11 @@
                                                  METRICS_STORAGE_AREA_CACHE_HIT_COUNT,
                                                  METRICS_STORAGE_AREA_CACHE_MISS_COUNT));
 
-        storageAreaReader_->SetCapacity(1);  // Put highest pressure
-        //storageAreaReader_->SetCapacity(1 * GIGABYTE);  // 1 GB - TODO-Streaming - Parameter
-        //storageAreaReader_->CreateCache(256 * MEGABYTE); // 256 MB - TODO-Streaming - Parameter
-        storageAreaReader_->CreateCache(1 * GIGABYTE); // 1 GB - TODO-Streaming - Parameter
+        //storageAreaReader_->SetCapacity(1);  // To test on highest pressure
+        storageAreaReader_->SetCapacity(256 * MEGABYTE); // TODO-Streaming - Parameter
+
+        //storageAreaReader_->CreateCache(256 * MEGABYTE); // TODO-Streaming - Parameter
+        storageAreaReader_->CreateCache(1 * GIGABYTE); // TODO-Streaming - Parameter
       }
 
       {
@@ -605,9 +606,10 @@
                                                  METRICS_DICOM_CACHE_HIT_COUNT,
                                                  METRICS_DICOM_CACHE_MISS_COUNT));
 
-        dicomReader_->SetCapacity(1);  // Put highest pressure
-        //dicomReader_->SetCapacity(1 * GIGABYTE);  // 1 GB - TODO-Streaming - Parameter
-        dicomReader_->CreateCache(256 * MEGABYTE); // 256 MB - TODO-Streaming - Parameter
+        //dicomReader_->SetCapacity(1);  // To test on highest pressure
+        dicomReader_->SetCapacity(256 * MEGABYTE); // TODO-Streaming - Parameter
+
+        dicomReader_->CreateCache(256 * MEGABYTE); // TODO-Streaming - Parameter
       }
 
       if (transcoder_.get() != NULL)
@@ -627,9 +629,10 @@
                                                  METRICS_TRANSCODER_CACHE_HIT_COUNT,
                                                  METRICS_TRANSCODER_CACHE_MISS_COUNT));
 
-        transcoderReader_->SetCapacity(1);  // Put highest pressure
-        //transcoderReader_->SetCapacity(1 * GIGABYTE);  // 1 GB - TODO-Streaming - Parameter
-        transcoderReader_->CreateCache(256 * MEGABYTE); // 256 MB - TODO-Streaming - Parameter
+        //transcoderReader_->SetCapacity(1);  // To test on highest pressure
+        transcoderReader_->SetCapacity(256 * MEGABYTE); // TODO-Streaming - Parameter
+
+        transcoderReader_->CreateCache(256 * MEGABYTE); // TODO-Streaming - Parameter
       }
 
       {