131 NS_LOG_FUNCTION(
this);
137 <<
" is not a valid output type for this statistics.");
147 "EnableContextPrinting",
155 EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
158 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
162 &MultiFileAggregator::Write1d);
177 EnumValue(UnitConversionCollector::TRANSPARENT));
181 &MultiFileAggregator::Write2d);
196 "EnableContextPrinting",
200 Ptr<MultiFileAggregator> fileAggregator =
202 NS_ASSERT(fileAggregator !=
nullptr);
206 DistributionCollector::OutputType_t outputType =
207 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
210 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
214 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
221 MakeCallback(&MultiFileAggregator::Write2d, fileAggregator));
225 MakeCallback(&MultiFileAggregator::AddContextHeading, fileAggregator));
229 MakeCallback(&MultiFileAggregator::EnableContextWarning, fileAggregator));
234 EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
237 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
239 Callback<void, double> callback =
245 it->second->TraceConnectWithoutContext(
"Output", callback);
259 DistributionCollector::OutputType_t outputType =
260 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
263 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
267 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
273 &MultiFileAggregator::Write2d);
276 &MultiFileAggregator::AddContextHeading);
279 &MultiFileAggregator::EnableContextWarning);
288 <<
" is not a valid output type for this statistics.");
298 Ptr<MagisterGnuplotAggregator> plotAggregator =
300 NS_ASSERT(plotAggregator !=
nullptr);
302 plotAggregator->SetLegend(
m_longLabel,
"Frequency");
303 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
308 EnumValue(UnitConversionCollector::TRANSPARENT));
314 const std::string context = it->second->GetName();
315 plotAggregator->Add2dDataset(context, context);
319 &MagisterGnuplotAggregator::Write2d);
334 Ptr<MagisterGnuplotAggregator> plotAggregator =
336 NS_ASSERT(plotAggregator !=
nullptr);
338 plotAggregator->SetLegend(
m_longLabel,
"Frequency");
339 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
345 DistributionCollector::OutputType_t outputType =
346 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
349 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
353 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
360 MakeCallback(&MagisterGnuplotAggregator::Write2d, plotAggregator));
366 EnumValue(ScalarCollector::INPUT_DATA_TYPE_DOUBLE));
369 EnumValue(ScalarCollector::OUTPUT_TYPE_AVERAGE_PER_SAMPLE));
371 Callback<void, double> callback =
377 it->second->TraceConnectWithoutContext(
"Output", callback);
388 Ptr<MagisterGnuplotAggregator> plotAggregator =
390 NS_ASSERT(plotAggregator !=
nullptr);
392 plotAggregator->SetLegend(
m_longLabel,
"Frequency");
393 plotAggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES);
397 DistributionCollector::OutputType_t outputType =
398 DistributionCollector::OUTPUT_TYPE_HISTOGRAM;
401 outputType = DistributionCollector::OUTPUT_TYPE_PROBABILITY;
405 outputType = DistributionCollector::OUTPUT_TYPE_CUMULATIVE;
413 const std::string context = it->second->GetName();
414 plotAggregator->Add2dDataset(context, context);
418 &MagisterGnuplotAggregator::Write2d);
425 NS_FATAL_ERROR(
"SatStatsLinkDelayHelper - Invalid output type");
540 NS_ASSERT_MSG(collector !=
nullptr,
"Unable to find collector with identifier " << identifier);
546 Ptr<ScalarCollector> c = collector->GetObject<ScalarCollector>();
547 NS_ASSERT(c !=
nullptr);
548 c->TraceSinkDouble(0.0, size);
554 Ptr<UnitConversionCollector> c = collector->GetObject<UnitConversionCollector>();
555 NS_ASSERT(c !=
nullptr);
556 c->TraceSinkDouble(0.0, size);
568 Ptr<ScalarCollector> c = collector->GetObject<ScalarCollector>();
569 NS_ASSERT(c !=
nullptr);
570 c->TraceSinkDouble(0.0, size);
574 Ptr<DistributionCollector> c = collector->GetObject<DistributionCollector>();
575 NS_ASSERT(c !=
nullptr);
576 c->TraceSinkDouble(0.0, size);
582 <<
" is not a valid output type for this statistics.");
623 NS_LOG_FUNCTION(
this);
625 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
626 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
632 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
633 Callback<void, uint32_t, const Address&> callback =
636 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
640 NS_ASSERT(satOrbiterDev !=
nullptr);
642 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhys = satOrbiterDev->GetFeederPhy();
643 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterFeederPhys.begin();
644 it2 != satOrbiterFeederPhys.end();
647 satPhy = it2->second;
648 NS_ASSERT(satPhy !=
nullptr);
650 NS_ASSERT(satOrbiterFeederPhy !=
nullptr);
652 if (satOrbiterFeederPhy->TraceConnectWithoutContext(
"QueueSizeBytes", callback))
654 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
655 <<
" device #" << satOrbiterDev->GetIfIndex());
659 NS_FATAL_ERROR(
"Error connecting to QueueSizeBytes trace source"
660 <<
" at node ID " << (*it)->GetId() <<
" device #"
661 << satOrbiterDev->GetIfIndex());
696 NS_LOG_FUNCTION(
this);
698 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
699 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
705 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
706 Callback<void, uint32_t, const Address&> callback =
709 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
713 NS_ASSERT(satOrbiterDev !=
nullptr);
715 std::map<uint32_t, Ptr<SatPhy>> satOrbiterFeederPhys = satOrbiterDev->GetFeederPhy();
716 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterFeederPhys.begin();
717 it2 != satOrbiterFeederPhys.end();
720 satPhy = it2->second;
721 NS_ASSERT(satPhy !=
nullptr);
723 NS_ASSERT(satOrbiterFeederPhy !=
nullptr);
725 if (satOrbiterFeederPhy->TraceConnectWithoutContext(
"QueueSizePackets", callback))
727 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
728 <<
" device #" << satOrbiterDev->GetIfIndex());
732 NS_FATAL_ERROR(
"Error connecting to QueueSizePackets trace source"
733 <<
" at node ID " << (*it)->GetId() <<
" device #"
734 << satOrbiterDev->GetIfIndex());
768 NS_LOG_FUNCTION(
this);
770 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
771 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
777 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
778 Callback<void, uint32_t, const Address&> callback =
781 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
785 NS_ASSERT(satOrbiterDev !=
nullptr);
787 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
788 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterUserPhys.begin();
789 it2 != satOrbiterUserPhys.end();
792 satPhy = it2->second;
793 NS_ASSERT(satPhy !=
nullptr);
794 Ptr<SatOrbiterUserPhy> satOrbiterUserPhy = satPhy->GetObject<
SatOrbiterUserPhy>();
795 NS_ASSERT(satOrbiterUserPhy !=
nullptr);
797 if (satOrbiterUserPhy->TraceConnectWithoutContext(
"QueueSizeBytes", callback))
799 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
800 <<
" device #" << satOrbiterDev->GetIfIndex());
804 NS_FATAL_ERROR(
"Error connecting to QueueSizeBytes trace source"
805 <<
" at node ID " << (*it)->GetId() <<
" device #"
806 << satOrbiterDev->GetIfIndex());
840 NS_LOG_FUNCTION(
this);
842 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
843 for (NodeContainer::Iterator it = uts.Begin(); it != uts.End(); ++it)
849 NodeContainer sats = Singleton<SatTopology>::Get()->GetOrbiterNodes();
850 Callback<void, uint32_t, const Address&> callback =
853 for (NodeContainer::Iterator it = sats.Begin(); it != sats.End(); ++it)
857 NS_ASSERT(satOrbiterDev !=
nullptr);
859 std::map<uint32_t, Ptr<SatPhy>> satOrbiterUserPhys = satOrbiterDev->GetUserPhy();
860 for (std::map<uint32_t, Ptr<SatPhy>>::iterator it2 = satOrbiterUserPhys.begin();
861 it2 != satOrbiterUserPhys.end();
864 satPhy = it2->second;
865 NS_ASSERT(satPhy !=
nullptr);
866 Ptr<SatOrbiterUserPhy> satOrbiterUserPhy = satPhy->GetObject<
SatOrbiterUserPhy>();
867 NS_ASSERT(satOrbiterUserPhy !=
nullptr);
869 if (satOrbiterUserPhy->TraceConnectWithoutContext(
"QueueSizePackets", callback))
871 NS_LOG_INFO(
this <<
" successfully connected with node ID " << (*it)->GetId()
872 <<
" device #" << satOrbiterDev->GetIfIndex());
876 NS_FATAL_ERROR(
"Error connecting to QueueSizePackets trace source"
877 <<
" at node ID " << (*it)->GetId() <<
" device #"
878 << satOrbiterDev->GetIfIndex());
Ptr< DataCollectionObject > CreateAggregator(std::string aggregatorTypeId, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue())
Create the aggregator according to the output type.