@@ -140,7 +140,7 void VariableAcquisitionWorker::abortProgressRequested(QUuid vIdentifier) | |||
|
140 | 140 | void VariableAcquisitionWorker::onVariableRetrieveDataInProgress(QUuid acqIdentifier, |
|
141 | 141 | double progress) |
|
142 | 142 | { |
|
143 |
qC |
|
|
143 | qCDebug(LOG_VariableAcquisitionWorker()) << tr("TORM: onVariableRetrieveDataInProgress ") | |
|
144 | 144 | << QThread::currentThread()->objectName() |
|
145 | 145 | << acqIdentifier << progress; |
|
146 | 146 | impl->lockRead(); |
@@ -153,8 +153,6 void VariableAcquisitionWorker::onVariableRetrieveDataInProgress(QUuid acqIdenti | |||
|
153 | 153 | = std::isnan(progress) ? 0.0 : (progress * progressPartSize) / 100.0; |
|
154 | 154 | |
|
155 | 155 | // We can only give an approximation of the currentProgression since its upgrade is async. |
|
156 | qCInfo(LOG_VariableAcquisitionWorker()) | |
|
157 | << tr("Progression: ") << aIdToARit->second.m_Progression << aIdToARit->second.m_Size; | |
|
158 | 156 | auto currentProgression = aIdToARit->second.m_Progression; |
|
159 | 157 | if (currentProgression == aIdToARit->second.m_Size) { |
|
160 | 158 | currentProgression = aIdToARit->second.m_Size - 1; |
@@ -165,15 +163,8 void VariableAcquisitionWorker::onVariableRetrieveDataInProgress(QUuid acqIdenti | |||
|
165 | 163 | |
|
166 | 164 | auto finalProgression = currentAlreadyProgress + currentPartProgress; |
|
167 | 165 | emit variableRequestInProgress(aIdToARit->second.m_vIdentifier, finalProgression); |
|
168 | qCInfo(LOG_VariableAcquisitionWorker()) | |
|
169 | << tr("TORM: onVariableRetrieveDataInProgress ") | |
|
170 | << QThread::currentThread()->objectName() << aIdToARit->second.m_vIdentifier | |
|
171 | << progressPartSize << currentAlreadyProgress << currentPartProgress | |
|
172 | << finalProgression; | |
|
173 | 166 | |
|
174 | 167 | if (finalProgression == 100.0) { |
|
175 | qCInfo(LOG_VariableAcquisitionWorker()) | |
|
176 | << tr("TORM: onVariableRetrieveDataInProgress : finished : 0.0 "); | |
|
177 | 168 | emit variableRequestInProgress(aIdToARit->second.m_vIdentifier, 0.0); |
|
178 | 169 | } |
|
179 | 170 | } |
@@ -189,14 +180,10 void VariableAcquisitionWorker::onVariableAcquisitionFailed(QUuid acqIdentifier) | |||
|
189 | 180 | if (it != impl->m_AcqIdentifierToAcqRequestMap.cend()) { |
|
190 | 181 | auto request = it->second; |
|
191 | 182 | impl->unlock(); |
|
192 | qCDebug(LOG_VariableAcquisitionWorker()) << tr("onVariableAcquisitionFailed") | |
|
193 | << acqIdentifier << request.m_vIdentifier | |
|
194 | << QThread::currentThread(); | |
|
195 | 183 | emit variableCanceledRequested(request.m_vIdentifier); |
|
196 | 184 | } |
|
197 | 185 | else { |
|
198 | 186 | impl->unlock(); |
|
199 | // TODO log no acqIdentifier recognized | |
|
200 | 187 | } |
|
201 | 188 | } |
|
202 | 189 | |
@@ -228,8 +215,6 void VariableAcquisitionWorker::onVariableDataAcquired(QUuid acqIdentifier, | |||
|
228 | 215 | |
|
229 | 216 | // Decrement the counter of the request |
|
230 | 217 | auto &acqRequest = aIdToARit->second; |
|
231 | qCInfo(LOG_VariableAcquisitionWorker()) << tr("TORM: +1 update progresson ") | |
|
232 | << acqIdentifier; | |
|
233 | 218 | acqRequest.m_Progression = acqRequest.m_Progression + 1; |
|
234 | 219 | |
|
235 | 220 | // if the counter is 0, we can return data then run the next request if it exists and |
@@ -318,7 +303,7 void VariableAcquisitionWorker::VariableAcquisitionWorkerPrivate::cancelVarReque | |||
|
318 | 303 | QUuid varRequestId) |
|
319 | 304 | { |
|
320 | 305 | qCDebug(LOG_VariableAcquisitionWorker()) |
|
321 |
<< "VariableAcquisitionWorkerPrivate::cancelVarRequest |
|
|
306 | << "VariableAcquisitionWorkerPrivate::cancelVarRequest start"; | |
|
322 | 307 | lockRead(); |
|
323 | 308 | // get all AcqIdentifier in link with varRequestId |
|
324 | 309 | QVector<QUuid> acqIdsToRm; |
@@ -374,9 +359,6 void VariableAcquisitionWorker::VariableAcquisitionWorkerPrivate::removeAcqReque | |||
|
374 | 359 | |
|
375 | 360 | lockWrite(); |
|
376 | 361 | |
|
377 | qCDebug(LOG_VariableAcquisitionWorker()) | |
|
378 | << "VariableAcquisitionWorkerPrivate::updateToNextRequest removeAcqRequest: " | |
|
379 | << acqRequestId; | |
|
380 | 362 | m_AcqIdentifierToAcqDataPacketVectorMap.erase(acqRequestId); |
|
381 | 363 | m_AcqIdentifierToAcqRequestMap.erase(acqRequestId); |
|
382 | 364 |
@@ -572,7 +572,7 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable> | |||
|
572 | 572 | } |
|
573 | 573 | impl->m_VarGroupIdToVarIds.insert(std::make_pair(varRequestId, varIds)); |
|
574 | 574 | for (const auto &var : variables) { |
|
575 |
qCDebug(LOG_VariableController()) << " |
|
|
575 | qCDebug(LOG_VariableController()) << "onRequestDataLoading: for" << varRequestId | |
|
576 | 576 | << varIds.size(); |
|
577 | 577 | impl->processRequest(var, range, varRequestId); |
|
578 | 578 | } |
@@ -591,6 +591,8 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable> | |||
|
591 | 591 | for (auto vId : vSyncIds) { |
|
592 | 592 | varIds.push_back(vId); |
|
593 | 593 | } |
|
594 | qCDebug(LOG_VariableController()) << "onRequestDataLoading sync: for" << varRequestId | |
|
595 | << varIds.size(); | |
|
594 | 596 | impl->m_VarGroupIdToVarIds.insert(std::make_pair(varRequestId, varIds)); |
|
595 | 597 | |
|
596 | 598 | for (auto vId : vSyncIds) { |
@@ -832,8 +834,6 void VariableController::VariableControllerPrivate::updateVariables(QUuid varReq | |||
|
832 | 834 | auto &varIds = varGroupIdToVarIdsIt->second; |
|
833 | 835 | auto varIdsEnd = varIds.end(); |
|
834 | 836 | bool processVariableUpdate = true; |
|
835 | qCDebug(LOG_VariableController()) << "VariableControllerPrivate::updateVariables" | |
|
836 | << varRequestId << varIds.size(); | |
|
837 | 837 | for (auto varIdsIt = varIds.begin(); (varIdsIt != varIdsEnd) && processVariableUpdate; |
|
838 | 838 | ++varIdsIt) { |
|
839 | 839 | auto itVarHandler = m_VarIdToVarRequestHandler.find(*varIdsIt); |
@@ -843,7 +843,6 void VariableController::VariableControllerPrivate::updateVariables(QUuid varReq | |||
|
843 | 843 | } |
|
844 | 844 | |
|
845 | 845 | if (processVariableUpdate) { |
|
846 | qCDebug(LOG_VariableController()) << "Final update OK for the var request" << varIds.size(); | |
|
847 | 846 | for (auto varIdsIt = varIds.begin(); varIdsIt != varIdsEnd; ++varIdsIt) { |
|
848 | 847 | auto itVarHandler = m_VarIdToVarRequestHandler.find(*varIdsIt); |
|
849 | 848 | if (itVarHandler != m_VarIdToVarRequestHandler.cend()) { |
@@ -862,7 +861,6 void VariableController::VariableControllerPrivate::updateVariables(QUuid varReq | |||
|
862 | 861 | << var->nbPoints(); |
|
863 | 862 | |
|
864 | 863 | emit var->updated(); |
|
865 | qCDebug(LOG_VariableController()) << tr("Update OK"); | |
|
866 | 864 | } |
|
867 | 865 | else { |
|
868 | 866 | qCCritical(LOG_VariableController()) |
@@ -894,13 +892,22 void VariableController::VariableControllerPrivate::updateVariableRequest(QUuid | |||
|
894 | 892 | |
|
895 | 893 | auto &varIds = varGroupIdToVarIdsIt->second; |
|
896 | 894 | auto varIdsEnd = varIds.end(); |
|
895 | ||
|
896 | // First pass all canUpdate of handler to false | |
|
897 | 897 | for (auto varIdsIt = varIds.begin(); (varIdsIt != varIdsEnd); ++varIdsIt) { |
|
898 | 898 | auto itVarHandler = m_VarIdToVarRequestHandler.find(*varIdsIt); |
|
899 | 899 | if (itVarHandler != m_VarIdToVarRequestHandler.cend()) { |
|
900 | 900 | |
|
901 | 901 | auto varHandler = itVarHandler->second.get(); |
|
902 | 902 | varHandler->m_CanUpdate = false; |
|
903 | } | |
|
904 | } | |
|
905 | // Second update requests of handler | |
|
906 | for (auto varIdsIt = varIds.begin(); (varIdsIt != varIdsEnd); ++varIdsIt) { | |
|
907 | auto itVarHandler = m_VarIdToVarRequestHandler.find(*varIdsIt); | |
|
908 | if (itVarHandler != m_VarIdToVarRequestHandler.cend()) { | |
|
903 | 909 | |
|
910 | auto varHandler = itVarHandler->second.get(); | |
|
904 | 911 | |
|
905 | 912 | switch (varHandler->m_State) { |
|
906 | 913 | case VariableRequestHandlerState::OFF: { |
@@ -1016,8 +1023,6 void VariableController::VariableControllerPrivate::cancelVariableRequest(QUuid | |||
|
1016 | 1023 | void VariableController::VariableControllerPrivate::executeVarRequest(std::shared_ptr<Variable> var, |
|
1017 | 1024 | VariableRequest &varRequest) |
|
1018 | 1025 | { |
|
1019 | qCDebug(LOG_VariableController()) << tr("TORM: executeVarRequest"); | |
|
1020 | ||
|
1021 | 1026 | auto varIdIt = m_VariableToIdentifierMap.find(var); |
|
1022 | 1027 | if (varIdIt == m_VariableToIdentifierMap.cend()) { |
|
1023 | 1028 | qCWarning(LOG_VariableController()) << tr( |
@@ -1055,6 +1060,8 void VariableController::VariableControllerPrivate::executeVarRequest(std::share | |||
|
1055 | 1060 | } |
|
1056 | 1061 | } |
|
1057 | 1062 | else { |
|
1063 | qCDebug(LOG_VariableController()) << "All already in the cache " | |
|
1064 | << varRequest.m_RangeRequested; | |
|
1058 | 1065 | acceptVariableRequest(varId, |
|
1059 | 1066 | var->dataSeries()->subDataSeries(varRequest.m_CacheRangeRequested)); |
|
1060 | 1067 | } |
|
1 | NO CONTENT: modified file |
@@ -135,12 +135,16 void AmdaProvider::onReplyDownloadProgress(QUuid acqIdentifier, | |||
|
135 | 135 | finalProgress = finalProgress / fraq; |
|
136 | 136 | } |
|
137 | 137 | |
|
138 |
qCDebug(LOG_AmdaProvider()) << tr(" |
|
|
138 | qCDebug(LOG_AmdaProvider()) << tr("final progress: ") | |
|
139 | << QThread::currentThread()->objectName() << acqIdentifier | |
|
140 | << fraq << finalProgress; | |
|
139 | 141 | emit dataProvidedProgress(acqIdentifier, finalProgress); |
|
140 | 142 | } |
|
141 | 143 | else { |
|
142 | 144 | // This case can happened when a progression is send after the request has been finished. |
|
143 | 145 | // Generaly the case when aborting a request |
|
146 | qCDebug(LOG_AmdaProvider()) << tr("Acquisition request not found: final progress: 100 : ") | |
|
147 | << QThread::currentThread()->objectName() << acqIdentifier; | |
|
144 | 148 | emit dataProvidedProgress(acqIdentifier, 100.0); |
|
145 | 149 | } |
|
146 | 150 | } |
@@ -169,7 +173,6 void AmdaProvider::retrieveData(QUuid token, const SqpRange &dateTime, const QVa | |||
|
169 | 173 | QVariantHash urlProperties{{AMDA_SERVER_KEY, data.value(AMDA_SERVER_KEY)}}; |
|
170 | 174 | auto url = QUrl{QString{AMDA_URL_FORMAT}.arg(AmdaServer::instance().url(urlProperties), |
|
171 | 175 | startDate, endDate, productId)}; |
|
172 | qCInfo(LOG_AmdaProvider()) << tr("TORM AmdaProvider::retrieveData url:") << url; | |
|
173 | 176 | auto tempFile = std::make_shared<QTemporaryFile>(); |
|
174 | 177 | |
|
175 | 178 | // LAMBDA |
@@ -211,8 +214,8 void AmdaProvider::retrieveData(QUuid token, const SqpRange &dateTime, const QVa | |||
|
211 | 214 | if (reply->error() == QNetworkReply::NoError) { |
|
212 | 215 | auto downloadFileUrl = QUrl{QString{reply->readAll()}.trimmed()}; |
|
213 | 216 | |
|
214 | qCInfo(LOG_AmdaProvider()) | |
|
215 | << tr("TORM AmdaProvider::retrieveData downloadFileUrl:") << downloadFileUrl; | |
|
217 | qCDebug(LOG_AmdaProvider()) << tr("AmdaProvider::retrieveData downloadFileUrl:") | |
|
218 | << downloadFileUrl; | |
|
216 | 219 | // Executes request for downloading file // |
|
217 | 220 | |
|
218 | 221 | // Creates destination file |
@@ -238,7 +241,6 void AmdaProvider::retrieveData(QUuid token, const SqpRange &dateTime, const QVa | |||
|
238 | 241 | // //////////////// // |
|
239 | 242 | |
|
240 | 243 | auto request = std::make_shared<QNetworkRequest>(url); |
|
241 | qCDebug(LOG_AmdaProvider()) << tr("First Request creation") << request.get(); | |
|
242 | 244 | updateRequestProgress(token, request, 0.0); |
|
243 | 245 | |
|
244 | 246 | emit requestConstructed(request, token, httpFinishedLambda); |
@@ -247,7 +249,6 void AmdaProvider::retrieveData(QUuid token, const SqpRange &dateTime, const QVa | |||
|
247 | 249 | void AmdaProvider::updateRequestProgress(QUuid acqIdentifier, |
|
248 | 250 | std::shared_ptr<QNetworkRequest> request, double progress) |
|
249 | 251 | { |
|
250 | qCDebug(LOG_AmdaProvider()) << tr("updateRequestProgress request") << request.get(); | |
|
251 | 252 | auto acqIdToRequestProgressMapIt = m_AcqIdToRequestProgressMap.find(acqIdentifier); |
|
252 | 253 | if (acqIdToRequestProgressMapIt != m_AcqIdToRequestProgressMap.end()) { |
|
253 | 254 | auto &requestProgressMap = acqIdToRequestProgressMapIt->second; |
@@ -178,7 +178,7 struct SynchronizeOperation : public IFuzzingOperation { | |||
|
178 | 178 | fuzzingState.synchronizeVariable(variableId, syncGroupId); |
|
179 | 179 | |
|
180 | 180 | variableController.onRequestDataLoading({variableState.m_Variable}, variableState.m_Range, |
|
181 |
|
|
|
181 | true); | |
|
182 | 182 | } |
|
183 | 183 | }; |
|
184 | 184 |
@@ -73,30 +73,30 using Validators = std::vector<std::shared_ptr<IFuzzingValidator> >; | |||
|
73 | 73 | // ///////// // |
|
74 | 74 | |
|
75 | 75 | // Defaults values used when the associated properties have not been set for the test |
|
76 |
const auto ACQUISITION_TIMEOUT_DEFAULT_VALUE = |
|
|
77 |
const auto NB_MAX_OPERATIONS_DEFAULT_VALUE = 1 |
|
|
78 |
const auto NB_MAX_SYNC_GROUPS_DEFAULT_VALUE = |
|
|
79 |
const auto NB_MAX_VARIABLES_DEFAULT_VALUE = |
|
|
76 | const auto ACQUISITION_TIMEOUT_DEFAULT_VALUE = 100000; | |
|
77 | const auto NB_MAX_OPERATIONS_DEFAULT_VALUE = 160; | |
|
78 | const auto NB_MAX_SYNC_GROUPS_DEFAULT_VALUE = 8; | |
|
79 | const auto NB_MAX_VARIABLES_DEFAULT_VALUE = 30; | |
|
80 | 80 | const auto AVAILABLE_OPERATIONS_DEFAULT_VALUE = QVariant::fromValue( |
|
81 | OperationsTypes{{FuzzingOperationType::CREATE, {400., true}}, | |
|
81 | OperationsTypes{{FuzzingOperationType::CREATE, {40000., true}}, | |
|
82 | 82 | {FuzzingOperationType::DELETE, {0.0}}, // Delete operation is less frequent |
|
83 | 83 | {FuzzingOperationType::PAN_LEFT, {1.}}, |
|
84 | 84 | {FuzzingOperationType::PAN_RIGHT, {1.}}, |
|
85 |
{FuzzingOperationType::ZOOM_IN, { |
|
|
86 |
{FuzzingOperationType::ZOOM_OUT, { |
|
|
87 |
{FuzzingOperationType::SYNCHRONIZE, { |
|
|
88 |
{FuzzingOperationType::DESYNCHRONIZE, {0. |
|
|
85 | {FuzzingOperationType::ZOOM_IN, {1.}}, | |
|
86 | {FuzzingOperationType::ZOOM_OUT, {1.}}, | |
|
87 | {FuzzingOperationType::SYNCHRONIZE, {500.0}}, | |
|
88 | {FuzzingOperationType::DESYNCHRONIZE, {0.0}}}); | |
|
89 | 89 | const auto CACHE_TOLERANCE_DEFAULT_VALUE = 0.2; |
|
90 | 90 | |
|
91 | 91 | /// Min/max delays between each operation (in ms) |
|
92 |
const auto OPERATION_DELAY_BOUNDS_DEFAULT_VALUE = QVariant::fromValue(std::make_pair(20, |
|
|
92 | const auto OPERATION_DELAY_BOUNDS_DEFAULT_VALUE = QVariant::fromValue(std::make_pair(20, 3000)); | |
|
93 | 93 | |
|
94 | 94 | /// Validators for the tests (executed in the order in which they're defined) |
|
95 | 95 | const auto VALIDATORS_DEFAULT_VALUE = QVariant::fromValue( |
|
96 | 96 | ValidatorsTypes{{FuzzingValidatorType::RANGE, FuzzingValidatorType::DATA}}); |
|
97 | 97 | |
|
98 | 98 | /// Min/max number of operations to execute before calling validation |
|
99 |
const auto VALIDATION_FREQUENCY_BOUNDS_DEFAULT_VALUE = QVariant::fromValue(std::make_pair(2, |
|
|
99 | const auto VALIDATION_FREQUENCY_BOUNDS_DEFAULT_VALUE = QVariant::fromValue(std::make_pair(2, 10)); | |
|
100 | 100 | |
|
101 | 101 | |
|
102 | 102 | // /////// ////// |
@@ -374,6 +374,8 public: | |||
|
374 | 374 | auto waitAcquisition = nextValidationCounter == 0 |
|
375 | 375 | || forceWait; |
|
376 | 376 | |
|
377 | qCInfo(LOG_TestAmdaFuzzing()).noquote() << "Operation :" << i +1 << " on" | |
|
378 | << nbOperations; | |
|
377 | 379 | fuzzingOperation->execute(variableId, m_FuzzingState, m_VariableController, |
|
378 | 380 | m_Properties); |
|
379 | 381 | |
@@ -464,7 +466,7 void TestAmdaFuzzing::testFuzzing_data() | |||
|
464 | 466 | // Test cases // |
|
465 | 467 | // ////////// // |
|
466 | 468 | |
|
467 |
auto maxRange = SqpRange::fromDateTime({2017, 1, |
|
|
469 | auto maxRange = SqpRange::fromDateTime({2017, 1, 5}, {8, 0}, {2017, 1, 5}, {16, 0}); | |
|
468 | 470 | MetadataPool metadataPool{{{"dataType", "vector"}, {"xml:id", "c1_b"}}}; |
|
469 | 471 | |
|
470 | 472 | // Note: we don't use auto here as we want to pass std::shared_ptr<IDataProvider> as is in the |
@@ -479,18 +481,18 void TestAmdaFuzzing::testFuzzing_data() | |||
|
479 | 481 | // {PROVIDER_PROPERTY, QVariant::fromValue(provider)}, |
|
480 | 482 | // {CUSTOM_OPERATIONS_PROPERTY, CUSTOM_CASE_ONE}}; |
|
481 | 483 | |
|
482 | QTest::newRow("fuzzingTestZoom") << Properties{ | |
|
483 | {MAX_RANGE_PROPERTY, QVariant::fromValue(maxRange)}, | |
|
484 | {METADATA_POOL_PROPERTY, QVariant::fromValue(metadataPool)}, | |
|
485 | {PROVIDER_PROPERTY, QVariant::fromValue(provider)}, | |
|
486 | {CUSTOM_OPERATIONS_PROPERTY, CUSTOM_CASE_TWO}}; | |
|
484 | // QTest::newRow("fuzzingTestZoom") << Properties{ | |
|
485 | // {MAX_RANGE_PROPERTY, QVariant::fromValue(maxRange)}, | |
|
486 | // {METADATA_POOL_PROPERTY, QVariant::fromValue(metadataPool)}, | |
|
487 | // {PROVIDER_PROPERTY, QVariant::fromValue(provider)}, | |
|
488 | // {CUSTOM_OPERATIONS_PROPERTY, CUSTOM_CASE_TWO}}; | |
|
487 | 489 | |
|
488 | 490 | |
|
489 | 491 | //// Fuzzing |
|
490 |
|
|
|
491 |
|
|
|
492 |
|
|
|
493 |
|
|
|
492 | QTest::newRow("fuzzingTest") << Properties{ | |
|
493 | {MAX_RANGE_PROPERTY, QVariant::fromValue(maxRange)}, | |
|
494 | {METADATA_POOL_PROPERTY, QVariant::fromValue(metadataPool)}, | |
|
495 | {PROVIDER_PROPERTY, QVariant::fromValue(provider)}}; | |
|
494 | 496 | |
|
495 | 497 | } |
|
496 | 498 |
General Comments 0
You need to be logged in to leave comments.
Login now