diff --git a/Framework/Core/CMakeLists.txt b/Framework/Core/CMakeLists.txt index b31e951bb7ec1..9521a7b8ace10 100644 --- a/Framework/Core/CMakeLists.txt +++ b/Framework/Core/CMakeLists.txt @@ -394,6 +394,7 @@ foreach(w Forwarding ParallelPipeline ParallelProducer + PipelinedSourceEndOfStream SlowConsumer SlowProducerWithWildCard SimpleDataProcessingDevice01 @@ -431,6 +432,15 @@ if (BUILD_TESTING) # TODO: DanglingInput test not working for the moment [ERROR] Unable to relay # part. [WARN] Incoming data is already obsolete, not relaying. set_property(TEST test_Framework_test_DanglingInputs PROPERTY DISABLED TRUE) +# The ended lane never produces its timeslices, so the ordered consumers must not report them as dropped, +# but they must report a timeframe really missing on the live lane, or dropped by a device upstream. +set_property(TEST test_Framework_test_PipelinedSourceEndOfStream PROPERTY FAIL_REGULAR_EXPRESSION "CRITICAL\\] Some Lifetime::Timeframe data got dropped") +foreach(missing direct relayed) + add_test(NAME test_Framework_test_PipelinedSourceEndOfStream_${missing} + COMMAND O2test-framework-PipelinedSourceEndOfStream ${DPL_WORKFLOW_TESTS_EXTRA_OPTIONS} --run --shm-segment-size 20000000 --missing ${missing}) + set_tests_properties(test_Framework_test_PipelinedSourceEndOfStream_${missing} PROPERTIES LABELS "framework;workflow" TIMEOUT 30 + PASS_REGULAR_EXPRESSION "ordered-${missing}\\]: [^ ]*CRITICAL\\] Some Lifetime::Timeframe data got dropped starting at 20[^0-9]") +endforeach() endif() diff --git a/Framework/Core/include/Framework/DataProcessingDevice.h b/Framework/Core/include/Framework/DataProcessingDevice.h index b2281274acc87..436f17a8aa094 100644 --- a/Framework/Core/include/Framework/DataProcessingDevice.h +++ b/Framework/Core/include/Framework/DataProcessingDevice.h @@ -90,7 +90,8 @@ class DataProcessingDevice : public fair::mq::Device static void doRun(ServiceRegistryRef); static void doPrepare(ServiceRegistryRef); static void handleData(ServiceRegistryRef, InputChannelInfo&); - static bool tryDispatchComputation(ServiceRegistryRef ref, std::vector& completed); + /// @a drainingAtEndOfStream: the caller sends the end of stream itself, once all is processed. + static bool tryDispatchComputation(ServiceRegistryRef ref, std::vector& completed, bool drainingAtEndOfStream = false); protected: void error(const char* msg); diff --git a/Framework/Core/include/Framework/DataProcessingHelpers.h b/Framework/Core/include/Framework/DataProcessingHelpers.h index e19474447ed12..dff8a896c53a1 100644 --- a/Framework/Core/include/Framework/DataProcessingHelpers.h +++ b/Framework/Core/include/Framework/DataProcessingHelpers.h @@ -47,6 +47,10 @@ struct DataProcessingHelpers { static bool sendOldestPossibleTimeframe(ServiceRegistryRef const& ref, OutputChannelInfo const& info, OutputChannelState& state, size_t timeslice); /// Broadcast the oldest possible timeslice to all channels in output static void broadcastOldestPossibleTimeslice(ServiceRegistryRef const& ref, size_t timeslice); + /// An ordered consumer skips the timeslices from @a from to @a to, excluded: report them as dropped. + static void skipTimeslices(ServiceRegistryRef const& ref, int64_t from, int64_t to); + /// An ordered consumer consumes @a timeslice: report what was skipped before in the same source lane. + static void consumeTimeslice(ServiceRegistryRef const& ref, int64_t timeslice); /// change the device StreamingState to newState static void switchState(ServiceRegistryRef const& ref, StreamingState newState); /// check if spec is a source devide diff --git a/Framework/Core/include/Framework/DeviceSpec.h b/Framework/Core/include/Framework/DeviceSpec.h index a22fc7eb1b7dc..c1f0ba98e6a35 100644 --- a/Framework/Core/include/Framework/DeviceSpec.h +++ b/Framework/Core/include/Framework/DeviceSpec.h @@ -68,6 +68,9 @@ struct DeviceSpec { size_t inputTimesliceId; /// The maximum number of time pipelining for this device. size_t maxInputTimeslices; + /// The lcm of the lane counts of the time pipelined, enumeration driven sources upstream: their + /// lane l gets the timeslices t with t % lanes == l, and a lane can end before the others. + size_t upstreamSourceLanes = 1; /// The completion policy to use for this device. CompletionPolicy completionPolicy; DispatchPolicy dispatchPolicy; diff --git a/Framework/Core/src/CommonServices.cxx b/Framework/Core/src/CommonServices.cxx index 751d7849df1c1..025d25d2d1037 100644 --- a/Framework/Core/src/CommonServices.cxx +++ b/Framework/Core/src/CommonServices.cxx @@ -597,17 +597,11 @@ auto decongestionCallbackOrdered = [](AsyncTask& task, size_t id) -> void { auto& ref = task.user().ref; auto& decongestion = ref.get(); - auto& state = ref.get(); auto& timesliceIndex = ref.get(); - O2_SIGNPOST_ID_GENERATE(cid, async_queue); int64_t oldNextTimeslice = decongestion.nextTimeslice; decongestion.nextTimeslice = std::max(decongestion.nextTimeslice, (int64_t)oldestPossibleOutput.timeslice.value); if (oldNextTimeslice != decongestion.nextTimeslice) { - if (state.transitionHandling != TransitionHandlingState::NoTransition && DefaultsHelpers::onlineDeploymentMode()) { - O2_SIGNPOST_EVENT_EMIT_WARN(async_queue, cid, "oldest_possible_timeslice", "Stop transition requested. Some Lifetime::Timeframe data got dropped starting at %" PRIi64, oldNextTimeslice); - } else { - O2_SIGNPOST_EVENT_EMIT_CRITICAL(async_queue, cid, "oldest_possible_timeslice", "Some Lifetime::Timeframe data got dropped starting at %" PRIi64, oldNextTimeslice); - } + DataProcessingHelpers::skipTimeslices(ref, oldNextTimeslice, decongestion.nextTimeslice); timesliceIndex.rescan(); } }; @@ -676,6 +670,7 @@ o2::framework::ServiceSpec break; } } + decongestion->pendingGaps.assign(services.get().upstreamSourceLanes, -1); auto& queue = services.get(); decongestion->oldestPossibleTimesliceTask = AsyncQueueHelpers::create(queue, {.name = "oldest-possible-timeslice", .score = 100}); return ServiceHandle{TypeIdHelpers::uniqueId(), decongestion, ServiceKind::Serial}; @@ -752,6 +747,7 @@ o2::framework::ServiceSpec decongestion->nextEnumerationTimesliceRewinded = false; decongestion->lastTimeslice = 0; decongestion->nextTimeslice = 0; + std::ranges::fill(decongestion->pendingGaps, -1); decongestion->oldestPossibleTimesliceTask = {0}; auto &state = services.get(); for (auto &channel : state.inputChannelInfos) { diff --git a/Framework/Core/src/CompletionPolicyHelpers.cxx b/Framework/Core/src/CompletionPolicyHelpers.cxx index d2c63cbf4c90b..08c55e9c82d23 100644 --- a/Framework/Core/src/CompletionPolicyHelpers.cxx +++ b/Framework/Core/src/CompletionPolicyHelpers.cxx @@ -11,6 +11,7 @@ #include "Framework/CompletionPolicyHelpers.h" #include "Framework/CompletionPolicy.h" +#include "Framework/DataProcessingHelpers.h" #include "Framework/DataProcessingHeader.h" #include "Framework/InputSpan.h" #include "Framework/DeviceSpec.h" @@ -191,7 +192,7 @@ CompletionPolicy CompletionPolicyHelpers::consumeWhenAllOrdered(const char* name return CompletionPolicy::CompletionOp::Retry; } } - decongestionService.nextTimeslice++; + DataProcessingHelpers::consumeTimeslice(ref, decongestionService.nextTimeslice++); return CompletionPolicy::CompletionOp::ConsumeAndRescan; }; return CompletionPolicy{name, matcher, callbackFull}; diff --git a/Framework/Core/src/DataProcessingDevice.cxx b/Framework/Core/src/DataProcessingDevice.cxx index b181eda458056..fba1994bb7e0c 100644 --- a/Framework/Core/src/DataProcessingDevice.cxx +++ b/Framework/Core/src/DataProcessingDevice.cxx @@ -1550,7 +1550,9 @@ void DataProcessingDevice::doPrepare(ServiceRegistryRef ref) O2_SIGNPOST_END(device, dpid, "do_prepare", "Nothing to poll. Waiting for next iteration."); return; } - auto currentOldest = state.inputChannelInfos[pollOrder.front()].oldestForChannel; + // A completed channel with nothing left to relay will not send anything anymore, so it must not hold back the others. + auto oldestRunning = std::ranges::find_if(pollOrder, [&infos = state.inputChannelInfos](int a) { return infos[a].state != InputChannelState::Completed || infos[a].parts.Size(); }); + auto currentOldest = state.inputChannelInfos[oldestRunning != pollOrder.end() ? *oldestRunning : pollOrder.front()].oldestForChannel; auto currentNewest = state.inputChannelInfos[pollOrder.back()].oldestForChannel; auto delta = currentNewest.value - currentOldest.value; O2_SIGNPOST_EVENT_EMIT(device, dpid, "do_prepare", "Oldest possible timeframe range %" PRIu64 " => %" PRIu64 " delta %" PRIu64, @@ -1729,8 +1731,27 @@ void DataProcessingDevice::doRun(ServiceRegistryRef ref) bool shouldProcess = DataProcessingHelpers::hasOnlyGenerated(spec) == false; - while (DataProcessingDevice::tryDispatchComputation(ref, streamContext.completed) && shouldProcess) { - relayer.processDanglingInputs(context.expirationHandlers, *context.registry, false); + auto& decongestion = ref.get(); + while (true) { + while (DataProcessingDevice::tryDispatchComputation(ref, streamContext.completed, true) && shouldProcess) { + relayer.processDanglingInputs(context.expirationHandlers, *context.registry, false); + } + // No input can arrive anymore, so an ordered consumer must not wait for the timeslices it misses. + if (!shouldProcess || !decongestion.orderedCompletionPolicyActive) { + break; + } + auto& index = ref.get(); + auto oldest = std::numeric_limits::max(); + for (size_t si = 0; si < index.size(); si++) { + if (index.isValid(TimesliceSlot{si})) { + oldest = std::min(oldest, (int64_t)VariableContextHelpers::getTimeslice(index.getVariablesForSlot(TimesliceSlot{si})).value); + } + } + if (oldest == std::numeric_limits::max() || oldest <= decongestion.nextTimeslice) { + break; + } + DataProcessingHelpers::skipTimeslices(ref, std::exchange(decongestion.nextTimeslice, oldest), oldest); + index.rescan(); } auto& timingInfo = ref.get(); @@ -2115,6 +2136,11 @@ void DataProcessingDevice::handleData(ServiceRegistryRef ref, InputChannelInfo& } auto it = std::remove_if(parts.fParts.begin(), parts.fParts.end(), [](auto& msg) -> bool { return msg.get() == nullptr; }); parts.fParts.erase(it, parts.end()); + // Once completed with nothing left to relay, the channel no longer holds back the oldest possible input. + if (info.channelType == ChannelAccountingType::DPL && info.state == InputChannelState::Completed && parts.Size() == 0) { + auto& context = ref.get(); + context.domainInfoUpdatedCallback(*context.registry, info.oldestForChannel.value, info.id); + } if (parts.fParts.size()) { LOG(debug) << parts.fParts.size() << " messages backpressured"; } @@ -2186,7 +2212,7 @@ void update_maximum(std::atomic& maximum_value, T const& value) noexcept } } // namespace -bool DataProcessingDevice::tryDispatchComputation(ServiceRegistryRef ref, std::vector& completed) +bool DataProcessingDevice::tryDispatchComputation(ServiceRegistryRef ref, std::vector& completed, bool drainingAtEndOfStream) { auto& context = ref.get(); LOGP(debug, "DataProcessingDevice::tryDispatchComputation"); @@ -2620,7 +2646,7 @@ bool DataProcessingDevice::tryDispatchComputation(ServiceRegistryRef ref, std::v O2_SIGNPOST_END(device, sid, "device", "Start processing ready actions"); // We now broadcast the end of stream if it was requested - if (state.streaming == StreamingState::EndOfStreaming) { + if (state.streaming == StreamingState::EndOfStreaming && !drainingAtEndOfStream) { LOGP(detail, "Broadcasting end of stream"); for (auto& channel : spec.outputChannels) { DataProcessingHelpers::sendEndOfStream(ref, channel); diff --git a/Framework/Core/src/DataProcessingHelpers.cxx b/Framework/Core/src/DataProcessingHelpers.cxx index a29e7b345c94c..ae01b0dfa8729 100644 --- a/Framework/Core/src/DataProcessingHelpers.cxx +++ b/Framework/Core/src/DataProcessingHelpers.cxx @@ -118,6 +118,44 @@ void DataProcessingHelpers::broadcastOldestPossibleTimeslice(ServiceRegistryRef } } +namespace +{ +void reportDroppedTimeslices(ServiceRegistryRef const& ref, int64_t timeslice) +{ + O2_SIGNPOST_ID_GENERATE(sid, device); + if (ref.get().transitionHandling != TransitionHandlingState::NoTransition && DefaultsHelpers::onlineDeploymentMode()) { + O2_SIGNPOST_EVENT_EMIT_WARN(device, sid, "oldest_possible_timeslice", "Stop transition requested. Some Lifetime::Timeframe data got dropped starting at %" PRIi64, timeslice); + } else { + O2_SIGNPOST_EVENT_EMIT_CRITICAL(device, sid, "oldest_possible_timeslice", "Some Lifetime::Timeframe data got dropped starting at %" PRIi64, timeslice); + } +} +} // namespace + +void DataProcessingHelpers::skipTimeslices(ServiceRegistryRef const& ref, int64_t from, int64_t to) +{ + // Behind time pipelined sources (DeviceSpec::upstreamSourceLanes) the timeslices of a lane which ended are + // skipped too, without any loss: report a gap only once a later timeslice of the same lane is consumed. + auto& gaps = ref.get().pendingGaps; + auto lanes = (int64_t)gaps.size(); + if (lanes <= 1) { + reportDroppedTimeslices(ref, from); + return; + } + O2_SIGNPOST_ID_GENERATE(sid, device); + O2_SIGNPOST_EVENT_EMIT(device, sid, "oldest_possible_timeslice", "Skipping timeslices from %" PRIi64 " to %" PRIi64 ", dropped if their lane goes on", from, to); + for (auto t = from; t < std::min(to, from + lanes); t++) { + gaps[t % lanes] = gaps[t % lanes] < 0 ? t : gaps[t % lanes]; + } +} + +void DataProcessingHelpers::consumeTimeslice(ServiceRegistryRef const& ref, int64_t timeslice) +{ + auto& gaps = ref.get().pendingGaps; + if (gaps.size() > 1 && gaps[timeslice % gaps.size()] >= 0) { + reportDroppedTimeslices(ref, std::exchange(gaps[timeslice % gaps.size()], -1)); + } +} + void DataProcessingHelpers::switchState(ServiceRegistryRef const& ref, StreamingState newState) { auto& state = ref.get(); diff --git a/Framework/Core/src/DecongestionService.h b/Framework/Core/src/DecongestionService.h index fe7fce8d640db..f0a801d8eaa5d 100644 --- a/Framework/Core/src/DecongestionService.h +++ b/Framework/Core/src/DecongestionService.h @@ -12,6 +12,7 @@ #ifndef O2_FRAMEWORK_DECONGESTIONSERVICE_H_ #define O2_FRAMEWORK_DECONGESTIONSERVICE_H_ #include "Framework/AsyncQueue.h" +#include namespace o2::framework { @@ -31,6 +32,9 @@ struct DecongestionService { /// The next timeslice we should consume, when running in order, /// using an ordered completion policy. int64_t nextTimeslice = 0; + /// The oldest timeslice skipped by an ordered consumer and not reported yet, per source lane, -1 if none + /// (see DataProcessingHelpers::skipTimeslices). + std::vector pendingGaps; /// Ordered completion policy is active. bool orderedCompletionPolicyActive = false; /// consumeWhenPastOldestPossibleTimeframe completion policy is active. diff --git a/Framework/Core/src/DeviceSpecHelpers.cxx b/Framework/Core/src/DeviceSpecHelpers.cxx index 4c19e7a6ff17b..ae36718204672 100644 --- a/Framework/Core/src/DeviceSpecHelpers.cxx +++ b/Framework/Core/src/DeviceSpecHelpers.cxx @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -1231,8 +1232,19 @@ void DeviceSpecHelpers::dataProcessorSpecs2DeviceSpecs(const WorkflowSpec& workf WorkflowHelpers::validateEdges(workflow, policiesVector, logicalEdges, outputs); + std::vector upstreamSourceLanes(workflow.size(), 1); + for (bool changed = true; changed;) { + changed = false; + for (auto& edge : logicalEdges) { + auto& producer = workflow[edge.producer]; + bool enumeratedSource = std::ranges::all_of(producer.inputs, [](InputSpec const& input) { return input.lifetime == Lifetime::Enumeration; }); + auto lanes = std::lcm(upstreamSourceLanes[edge.consumer], std::lcm(upstreamSourceLanes[edge.producer], enumeratedSource ? producer.maxInputTimeslices : 1)); + changed |= std::exchange(upstreamSourceLanes[edge.consumer], lanes) != lanes; + } + } for (auto& device : devices) { device.resourceMonitoringInterval = resourcesMonitoringInterval; + device.upstreamSourceLanes = upstreamSourceLanes[std::ranges::find(workflow, device.name, &DataProcessorSpec::name) - workflow.begin()]; } auto findDeviceIndex = [&deviceIndex](size_t processorIndex, size_t timeslice) { diff --git a/Framework/Core/src/TimesliceIndex.cxx b/Framework/Core/src/TimesliceIndex.cxx index df98eea3cc9d0..1bfe5fa79d94e 100644 --- a/Framework/Core/src/TimesliceIndex.cxx +++ b/Framework/Core/src/TimesliceIndex.cxx @@ -148,12 +148,14 @@ TimesliceIndex::OldestInputInfo TimesliceIndex::setOldestPossibleInput(Timeslice timestamp.value, channel.value, mChannels[channel.value].oldestForChannel.value); } mChannels[channel.value].oldestForChannel = timestamp; - OldestInputInfo result{timestamp, channel}; + // A completed channel with nothing left to relay will not send anything anymore. + auto done = [](InputChannelInfo const& info) { return info.state == InputChannelState::Completed && info.parts.Size() == 0; }; + OldestInputInfo result{done(mChannels[channel.value]) ? TimesliceId{TimesliceId::INVALID} : timestamp, channel}; bool changed = false; for (int ci = 0; ci < mChannels.size(); ci++) { - // Check if this is a real channel. Skip otherwise. + // Check if this is a real channel which can still send data. Skip otherwise. auto& channelRef = mChannels[ci]; - if (channelRef.channelType != ChannelAccountingType::DPL) { + if (channelRef.channelType != ChannelAccountingType::DPL || done(channelRef)) { continue; } auto& a = channelRef.oldestForChannel; @@ -162,6 +164,10 @@ TimesliceIndex::OldestInputInfo TimesliceIndex::setOldestPossibleInput(Timeslice result = {a, ChannelIndex{ci}}; } } + if (TimesliceId::isValid(result.timeslice) == false) { + // Every channel completed: nothing can arrive anymore. + result = mOldestPossibleInput; + } if (changed && mOldestPossibleInput.timeslice.value != result.timeslice.value) { O2_SIGNPOST_EVENT_EMIT(timeslice_index, tid, "setOldestPossibleInput", "Success (channel %d): Oldest possible input is %zu due to channel %d", channel.value, result.timeslice.value, result.channel.value); diff --git a/Framework/Core/test/test_PipelinedSourceEndOfStream.cxx b/Framework/Core/test/test_PipelinedSourceEndOfStream.cxx new file mode 100644 index 0000000000000..daacac17c2d33 --- /dev/null +++ b/Framework/Core/test/test_PipelinedSourceEndOfStream.cxx @@ -0,0 +1,90 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include "Framework/CompletionPolicyHelpers.h" +#include "Framework/ConfigParamSpec.h" + +void customize(std::vector& policies) +{ + policies.push_back(o2::framework::CompletionPolicyHelpers::consumeWhenAllOrdered("ordered-.*")); +} + +void customize(std::vector& options) +{ + options.push_back(o2::framework::ConfigParamSpec{"missing", o2::framework::VariantType::String, "", {"timeframe missing: direct or relayed"}}); +} + +#include "Framework/CallbackService.h" +#include "Framework/ControlService.h" +#include "Framework/DeviceSpec.h" +#include "Framework/EndOfStreamContext.h" +#include "Framework/Logger.h" +#include "Framework/runDataProcessing.h" + +using namespace o2::framework; + +// A source with two time-pipelined lanes, like the AOD reader with --readers 2, +// where one lane has nothing to read and ends immediately. The other lane must +// still deliver all its data: the completed channel must hold back neither the +// polling of the other channel nor the oldest possible timeslice. +// ordered-consumer sends what it gets on to after-ordered, which must get all of +// it before the end of stream of ordered-consumer. +// No ordered consumer, whether it reads the lanes directly (ordered-direct) or +// behind another device (ordered-consumer, ordered-relayed), must report the +// timeslices of the ended lane as dropped. A timeframe really missing must be: +// with --missing direct, the live lane does not send it to ordered-direct; with +// --missing relayed, relay drops it on its way to ordered-relayed. +constexpr int nTimeframes = 100; +constexpr int missingTimeframe = 10; + +DataProcessorSpec consumer(std::string name, InputSpec input, std::vector outputs = {}, int expected = nTimeframes, int drop = -1) +{ + return DataProcessorSpec{ + .name = name, + .inputs = {input}, + .outputs = outputs, + .algorithm = adaptStateful([relay = !outputs.empty(), expected, drop](CallbackService& callbacks) { + static int received = 0; + callbacks.set([expected](EndOfStreamContext&) { + if (received != expected) { + LOGP(fatal, "Received {} timeframes, expected {}", received, expected); + } + }); + return adaptStateless([relay, drop](InputRecord& inputs, DataAllocator& allocator) { + received++; + if (relay && inputs.get("data") != drop) { + allocator.make(OutputRef{"out"}) = inputs.get("data"); + } + }); + })}; +} + +WorkflowSpec defineDataProcessing(ConfigContext const& config) +{ + auto missing = config.options().get("missing"); + return WorkflowSpec{ + timePipeline(DataProcessorSpec{ + .name = "producer", + .outputs = {OutputSpec{{"data"}, "TST", "PIPELINED", 0}, OutputSpec{{"direct"}, "TST", "PIPELINED", 1}}, + .algorithm = adaptStateless([missing](DataAllocator& outputs, ControlService& control, DeviceSpec const& spec) { + static int sent = 0; + if (spec.inputTimesliceId == 1 || sent == nTimeframes) { + control.endOfStream(); + control.readyToQuit(QuitRequest::Me); + return; + } + if (missing != "direct" || sent != missingTimeframe) { + outputs.make(Output{"TST", "PIPELINED", 1}) = sent; + } + outputs.make(Output{"TST", "PIPELINED", 0}) = sent++; + })}, + 2), + consumer("consumer", {"data", "TST", "PIPELINED", 0}), consumer("ordered-consumer", {"data", "TST", "PIPELINED", 0}, {OutputSpec{{"out"}, "TST", "ORDERED"}}), consumer("after-ordered", {"data", "TST", "ORDERED"}), consumer("ordered-direct", {"data", "TST", "PIPELINED", 1}, {}, nTimeframes - (missing == "direct")), consumer("relay", {"data", "TST", "PIPELINED", 0}, {OutputSpec{{"out"}, "TST", "RELAYED"}}, nTimeframes, missing == "relayed" ? missingTimeframe : -1), consumer("ordered-relayed", {"data", "TST", "RELAYED"}, {}, nTimeframes - (missing == "relayed"))}; +}