Mercurial > hg > orthanc
comparison OrthancServer/Sources/ServerContext.cpp @ 4941:96a3e81eba90 more-tags
performance warning
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 16 Mar 2022 09:50:33 +0100 |
parents | 304514ce84ee |
children | f377d5643538 |
comparison
equal
deleted
inserted
replaced
4940:304514ce84ee | 4941:96a3e81eba90 |
---|---|
2544 } | 2544 } |
2545 | 2545 |
2546 // possibly merge missing requested tags from dicom-as-json | 2546 // possibly merge missing requested tags from dicom-as-json |
2547 if (!resource.missingRequestedTags_.empty() && !DicomMap::HasOnlyComputedTags(resource.missingRequestedTags_)) | 2547 if (!resource.missingRequestedTags_.empty() && !DicomMap::HasOnlyComputedTags(resource.missingRequestedTags_)) |
2548 { | 2548 { |
2549 OrthancConfiguration::ReaderLock lock; | |
2550 if (lock.GetConfiguration().IsStorageAccessOnFindLogsEnabled()) | |
2551 { | |
2552 std::set<DicomTag> missingTags; | |
2553 Toolbox::AppendSets(missingTags, resource.missingRequestedTags_); | |
2554 for (std::set<DicomTag>::const_iterator it = resource.missingRequestedTags_.begin(); it != resource.missingRequestedTags_.end(); it++) | |
2555 { | |
2556 if (DicomMap::IsComputedTag(*it)) | |
2557 { | |
2558 missingTags.erase(*it); | |
2559 } | |
2560 } | |
2561 | |
2562 std::string missings; | |
2563 FromDcmtkBridge::FormatListOfTags(missings, missingTags); | |
2564 | |
2565 LOG(WARNING) << "PERFORMANCE WARNING: Accessing Dicom tags from storage when accessing " << Orthanc::GetResourceTypeText(resource.type_, false , false) << " : " << missings; | |
2566 } | |
2567 | |
2568 | |
2549 std::string instanceId_ = instanceId; | 2569 std::string instanceId_ = instanceId; |
2550 DicomMap tagsFromJson; | 2570 DicomMap tagsFromJson; |
2551 | 2571 |
2552 if (dicomAsJson == NULL) | 2572 if (dicomAsJson == NULL) |
2553 { | 2573 { |
2567 } | 2587 } |
2568 instanceId_ = instancesIds.front(); | 2588 instanceId_ = instancesIds.front(); |
2569 } | 2589 } |
2570 } | 2590 } |
2571 | 2591 |
2572 // MORE_TAGS :TODO: log "performance" warning (add an option to disable them) | |
2573 Json::Value tmpDicomAsJson; | 2592 Json::Value tmpDicomAsJson; |
2574 ReadDicomAsJson(tmpDicomAsJson, instanceId_); | 2593 ReadDicomAsJson(tmpDicomAsJson, instanceId_); |
2575 tagsFromJson.FromDicomAsJson(tmpDicomAsJson); | 2594 tagsFromJson.FromDicomAsJson(tmpDicomAsJson); |
2576 } | 2595 } |
2577 else | 2596 else |