![]() |
MAK RTIspy API Documentation for HLA 1.3
|
DtInitiatorLatencyTest runs network connectivity tests between local RTI components. More...
Inheritance diagram for DtInitiatorLatencyTest:
Collaboration diagram for DtInitiatorLatencyTest:Public Member Functions | |
| DtInitiatorLatencyTest (DtTestManager *parent) | |
| Constructor. | |
| DtInitiatorLatencyTest () | |
| Constructor. | |
| virtual | ~DtInitiatorLatencyTest () |
| Destructor. | |
| virtual bool | tick () |
| Process test activities. | |
| virtual void | addSendInteractionTimeStamp (unsigned int testID) |
| Record the current time and associate it with the input test ID in myTestsInProgressTimeStamp with a send Interaction time stamp. | |
| virtual void | addNetSendTimeStamp (unsigned int testID, DtRtiMsg &msg) |
| Record the current time and associate it with the input test ID in myTestsInProgressTimeStamp with a net send time stamp. | |
| virtual void | addNetReceiveTimeStamp (unsigned int testID, const DtRtiMsg &msg) |
| Record the current time and associate it with the input test ID in myTestsInProgressTimeStamp with a net receive time stamp. | |
| virtual void | addReceiveInteractionTimeStamp (unsigned int testID, MAKRti::DtTime timeToUse) |
| Record the current time and associate it with the input test ID in myTestsInProgressTimeStamp with a receive interaction time stamp. | |
| virtual void | addAsyncQueueMsgTimeStamp (unsigned int testID, const DtRtiMsg &msg) |
| Record the current time and associate it with the input test ID in myTestsInProgressTimeStamp with a async Queue Msg time stamp. | |
| virtual bool | canInitiateTest () const |
| Make sure we're not currently running a test and that there are other federates to send to. | |
| virtual bool | takeCompletedTestReport (unsigned int trialID, DtAveragedLatencyTestReport &takenReport) |
| virtual void | initiateLatencyTest (unsigned int trialID, unsigned int numInteractions, unsigned int sizeOfPayload, MAKRti::DtTime periodBetweenSends, DtFederateHandle handle) |
| Initiate a Latency Test. | |
| virtual bool | testIsFinished (unsigned int testID) const |
| Query whether this test is finished. | |
| virtual void | getCurrentTestInfo (unsigned int &testID, DtFederateHandle &handle, MAKRti::DtTransportType &transport, unsigned int &payloadSize) const |
| the FederateHandle of the current recipient. | |
| virtual bool | trialIsFinished (unsigned int trialID) const |
| Is the trial finished. | |
Protected Types | |
| typedef std::pair< unsigned int, MAKRti::DtTransportType > | DtNumToTypePair |
| typedef std::multimap < DtFederateHandle, DtNumToTypePair > | DtFedHandleToTestMap |
Protected Member Functions | |
| virtual bool | getCompletedReportByTestID (unsigned int testID, DtLatencyTestReportStruct &report) const |
| generate a report of the specified testID. | |
| virtual void | averageReports (const std::vector< DtLatencyTestReportStruct * > &bestEffortTests, const std::vector< DtLatencyTestReportStruct * > &reliableTests, DtFederateHandle recipientHandle, DtFederateHandle initiatorHandle, const MAKRti::DtString &recipientName, const MAKRti::DtString &initiatorName, DtRIDParameters::DtAsynchronousIOModeEnum recipientAsyncMode, DtRIDParameters::DtAsynchronousIOModeEnum initiatorAsyncMode, unsigned int numBestEffortDropped, unsigned int numReliableDropped, DtAveragedLatencyTestReport &averaged) const |
| Average contents of set of reports. | |
| virtual unsigned int | currTestId () const |
| Return the current test id. | |
| virtual void | consumeTestId () |
| set myInitatedTestId and advance the currentTestId. | |
Protected Attributes | |
| MAKRti::DtTime | myNextSend |
| unsigned short | myTestOffset |
| DtTestToTimeStampMap | myCompletedInitiatedTests |
| std::map< unsigned int, DtFederateHandle > | myFedHandleByTestID |
| unsigned int | myNumTestsToAverage |
| When running a latency test we will average results from myNumTestsToAverage latency interactions. | |
| MAKRti::DtTime | myLatencyInterval |
| When running a latency test, what is the interval between the myNumTestsToAverage interactions. | |
| unsigned int | myPayloadSize |
| When running a latency test, what is the size of the payload attached to interactions in bytes. | |
| std::map< unsigned int, DtRIDParameters::DtAsynchronousIOModeEnum > | myRecipientAsyncIOModeByFedHandle |
| What is the asynchronous processing mode of the recipient federate by FedHandle. | |
| std::set< unsigned int > | myInitiatedTestIDs |
| Set of known tests are not removed when the test is finished. | |
| std::map< unsigned int, DtFedHandleToTestMap > | myNumberOfInteractionsLeftByFederate |
| Map between trialIdentifier and federates involved in current trial and the number of Test Interactions we still have to send to each of them. | |
| std::map< unsigned int, DtRtiMtdFederateHostInformation::DtFederateHostInformation > | myRecipientHostInfoMap |
| Map between federate handle and federate Information. | |
| std::map< unsigned int, std::set< unsigned int > > | myTestIDsByTrial |
| Map between trialIdentifer and testIDs associated with the trial. | |
| DtFederateHandle | myFedHandleOfCurrentTest |
| unsigned int | myTestIDOfCurrentTest |
Private Member Functions | |
| DtInitiatorLatencyTest (DtInitiatorLatencyTest const &orig) | |
| Copy Constructor - not allowed. | |
| DtInitiatorLatencyTest & | operator= (DtInitiatorLatencyTest const &orig) |
| Assignment operator - not allowed. | |
DtInitiatorLatencyTest runs network connectivity tests between local RTI components.
typedef std::multimap<DtFederateHandle, DtNumToTypePair> DtInitiatorLatencyTest::DtFedHandleToTestMap [protected] |
Reimplemented from DtLatencyTest.
typedef std::pair<unsigned int, MAKRti::DtTransportType> DtInitiatorLatencyTest::DtNumToTypePair [protected] |
Constructor.
Constructor.
| DtInitiatorLatencyTest::~DtInitiatorLatencyTest | ( | ) | [virtual] |
Destructor.
| DtInitiatorLatencyTest::DtInitiatorLatencyTest | ( | DtInitiatorLatencyTest const & | orig | ) | [private] |
Copy Constructor - not allowed.
| void DtInitiatorLatencyTest::addAsyncQueueMsgTimeStamp | ( | unsigned int | testID, |
| const DtRtiMsg & | msg | ||
| ) | [virtual] |
Record the current time and associate it with the input test ID in myTestsInProgressTimeStamp with a async Queue Msg time stamp.
Implements DtLatencyTest.
References DtMetadataTypeTimeStampInitiatorAsynchronousQueue, DtMetadataTypeTimeStampRecipientNetRead, DtRtiMtdTimeStamp::get(), DtLatencyTest::myTestsInProgressTimeStamps, and DtLatencyTest::time().
Referenced by DtTestManager::addAsyncQueueMsgTimeStamp().
| void DtInitiatorLatencyTest::addNetReceiveTimeStamp | ( | unsigned int | testID, |
| const DtRtiMsg & | msg | ||
| ) | [virtual] |
Record the current time and associate it with the input test ID in myTestsInProgressTimeStamp with a net receive time stamp.
Implements DtLatencyTest.
References DtRtiMtdFederateHostInformation::DtFederateHostInformation::asyncMode, DtRIDParameters::DtAsynchronousCallbacks, DtMetadataTypeTimeStampInitiatorNetRead, DtMetadataTypeTimeStampRecipientAsynchronousQueue, DtMetadataTypeTimeStampRecipientNetRead, DtMetadataTypeTimeStampRecipientNetSend, DtMetadataTypeTimeStampRecipientReceiveInteraction, DtMetadataTypeTimeStampRecipientSendInteraction, DtRIDParameters::DtSynchronousMode, DtRtiMtdTimeStamp::get(), DtRtiMtdFederateHostInformation::get(), myFedHandleByTestID, myRecipientHostInfoMap, DtLatencyTest::myTestsInProgressTimeStamps, DtLatencyTest::myTransportByTestID, DtLatencyTest::time(), and DtRtiMsg::transportType().
Referenced by DtTestManager::addNetReceiveTimeStamp().
| void DtInitiatorLatencyTest::addNetSendTimeStamp | ( | unsigned int | testID, |
| DtRtiMsg & | msg | ||
| ) | [virtual] |
Record the current time and associate it with the input test ID in myTestsInProgressTimeStamp with a net send time stamp.
Implements DtLatencyTest.
References DtMetadataTypeTimeStampInitiatorNetSend, DtLatencyTest::myTestsInProgressTimeStamps, and DtLatencyTest::time().
Referenced by DtTestManager::addNetSendTimeStamp().
| void DtInitiatorLatencyTest::addReceiveInteractionTimeStamp | ( | unsigned int | testID, |
| MAKRti::DtTime | timeToUse | ||
| ) | [virtual] |
Record the current time and associate it with the input test ID in myTestsInProgressTimeStamp with a receive interaction time stamp.
Implements DtLatencyTest.
References DtMetadataTypeTimeStampInitiatorReceiveInteraction, myCompletedInitiatedTests, and DtLatencyTest::myTestsInProgressTimeStamps.
Referenced by DtTestManager::addReceiveInteractionTimeStamp().
| void DtInitiatorLatencyTest::addSendInteractionTimeStamp | ( | unsigned int | testID | ) | [virtual] |
Record the current time and associate it with the input test ID in myTestsInProgressTimeStamp with a send Interaction time stamp.
Implements DtLatencyTest.
References DtMetadataTypeTimeStampInitiatorSendInteraction, DtLatencyTest::myTestsInProgressTimeStamps, and DtLatencyTest::time().
Referenced by DtTestManager::addSendInteractionTimeStamp().
| void DtInitiatorLatencyTest::averageReports | ( | const std::vector< DtLatencyTestReportStruct * > & | bestEffortTests, |
| const std::vector< DtLatencyTestReportStruct * > & | reliableTests, | ||
| DtFederateHandle | recipientHandle, | ||
| DtFederateHandle | initiatorHandle, | ||
| const MAKRti::DtString & | recipientName, | ||
| const MAKRti::DtString & | initiatorName, | ||
| DtRIDParameters::DtAsynchronousIOModeEnum | recipientAsyncMode, | ||
| DtRIDParameters::DtAsynchronousIOModeEnum | initiatorAsyncMode, | ||
| unsigned int | numBestEffortDropped, | ||
| unsigned int | numReliableDropped, | ||
| DtAveragedLatencyTestReport & | averaged | ||
| ) | const [protected, virtual] |
Average contents of set of reports.
References DtTestManager::averageTickPeriod(), DtLatencyTest::myTestManager, DtAveragedLatencyTestReport::requiresQueueMsgStamp(), DtAveragedLatencyTestReport::setAverageBestEffortInitiatorMsgQueuedUsecs(), DtAveragedLatencyTestReport::setAverageBestEffortInitiatorReceiveInteractionUSecs(), DtAveragedLatencyTestReport::setAverageBestEffortInitiatorSendInteractionUSecs(), DtAveragedLatencyTestReport::setAverageBestEffortRecipientEncodeDecodeInteractionUSecs(), DtAveragedLatencyTestReport::setAverageBestEffortRecipientMsgQueuedUsecs(), DtAveragedLatencyTestReport::setAverageBestEffortRecipientReceiveInteractionUSecs(), DtAveragedLatencyTestReport::setAverageBestEffortRecipientSendInteractionUSecs(), DtAveragedLatencyTestReport::setAverageBestEffortRoundTripTime(), DtAveragedLatencyTestReport::setAverageInitiatorTickTimeUsecs(), DtAveragedLatencyTestReport::setAverageRecipientTickTimeUsecs(), DtAveragedLatencyTestReport::setAverageReliableInitiatorMsgQueuedUsecs(), DtAveragedLatencyTestReport::setAverageReliableInitiatorReceiveInteractionUSecs(), DtAveragedLatencyTestReport::setAverageReliableInitiatorSendInteractionUSecs(), DtAveragedLatencyTestReport::setAverageReliableRecipientEncodeDecodeInteractionUSecs(), DtAveragedLatencyTestReport::setAverageReliableRecipientMsgQueuedUsecs(), DtAveragedLatencyTestReport::setAverageReliableRecipientReceiveInteractionUSecs(), DtAveragedLatencyTestReport::setAverageReliableRecipientSendInteractionUSecs(), DtAveragedLatencyTestReport::setAverageReliableRoundTripTime(), DtAveragedLatencyTestReport::setFederationHandle(), DtAveragedLatencyTestReport::setInitiatorFedHandle(), DtAveragedLatencyTestReport::setInitiatorFedName(), DtAveragedLatencyTestReport::setInitiatorProcessingModel(), DtAveragedLatencyTestReport::setNumCompletedBestEffortInteractions(), DtAveragedLatencyTestReport::setNumCompletedReliableInteractions(), DtAveragedLatencyTestReport::setNumDroppedBestEffortInteractions(), DtAveragedLatencyTestReport::setNumDroppedReliableInteractions(), DtAveragedLatencyTestReport::setRecipientFedHandle(), DtAveragedLatencyTestReport::setRecipientFedName(), and DtAveragedLatencyTestReport::setRecipientProcessingModel().
Referenced by takeCompletedTestReport().
| bool DtInitiatorLatencyTest::canInitiateTest | ( | ) | const [virtual] |
Make sure we're not currently running a test and that there are other federates to send to.
References myNumberOfInteractionsLeftByFederate.
Referenced by DtTestManager::initiateLatencyTest().
| void DtInitiatorLatencyTest::consumeTestId | ( | ) | [protected, virtual] |
set myInitatedTestId and advance the currentTestId.
References DtRIDParameters::maxObjectsPerFederate(), DtLatencyTest::myTestManager, myTestOffset, and DtTestManager::params().
Referenced by tick().
| unsigned int DtInitiatorLatencyTest::currTestId | ( | ) | const [protected, virtual] |
Return the current test id.
References DtTestManager::connectMgr(), DtConnectionMgr::fedHandle(), DtRIDParameters::maxObjectsPerFederate(), DtLatencyTest::myTestManager, myTestOffset, and DtTestManager::params().
Referenced by tick().
| bool DtInitiatorLatencyTest::getCompletedReportByTestID | ( | unsigned int | testID, |
| DtLatencyTestReportStruct & | report | ||
| ) | const [protected, virtual] |
generate a report of the specified testID.
If the report has completed it returns the averaged report information in the report argument
References DtLatencyTest::DtLatencyTestReportStruct::averageRecipientTickPeriod, DtRIDParameters::DtAsynchronousCallbacks, DtMetadataTypeTimeStampInitiatorAsynchronousQueue, DtMetadataTypeTimeStampInitiatorNetRead, DtMetadataTypeTimeStampInitiatorNetSend, DtMetadataTypeTimeStampInitiatorReceiveInteraction, DtMetadataTypeTimeStampInitiatorSendInteraction, DtMetadataTypeTimeStampRecipientAsynchronousQueue, DtMetadataTypeTimeStampRecipientNetRead, DtMetadataTypeTimeStampRecipientNetSend, DtMetadataTypeTimeStampRecipientReceiveInteraction, DtMetadataTypeTimeStampRecipientSendInteraction, DtRIDParameters::DtSynchronousMode, DtLatencyTest::DtLatencyTestReportStruct::initiatorAsyncMode, DtLatencyTest::DtLatencyTestReportStruct::initiatorNetRead, DtLatencyTest::DtLatencyTestReportStruct::initiatorNetSend, DtLatencyTest::DtLatencyTestReportStruct::initiatorQueueMsg, DtLatencyTest::DtLatencyTestReportStruct::initiatorReceiveInteraction, DtLatencyTest::DtLatencyTestReportStruct::initiatorSendInteraction, myCompletedInitiatedTests, myFedHandleByTestID, myPayloadSize, myRecipientHostInfoMap, DtLatencyTest::myTestManager, DtLatencyTest::myTransportByTestID, DtLatencyTest::DtLatencyTestReportStruct::numbersAreReliable, DtTestManager::params(), DtRIDParameters::processingModel(), DtLatencyTest::DtLatencyTestReportStruct::recipientAsyncMode, DtLatencyTest::DtLatencyTestReportStruct::recipientName, DtLatencyTest::DtLatencyTestReportStruct::recipientNetRead, DtLatencyTest::DtLatencyTestReportStruct::recipientNetSend, DtLatencyTest::DtLatencyTestReportStruct::recipientQueueMsg, DtLatencyTest::DtLatencyTestReportStruct::recipientSendInteraction, DtLatencyTest::DtLatencyTestReportStruct::recipReceiveInteraction, DtLatencyTest::DtLatencyTestReportStruct::sizeOfPayload, DtLatencyTest::DtLatencyTestReportStruct::testID, and DtLatencyTest::time().
Referenced by takeCompletedTestReport().
| void DtInitiatorLatencyTest::getCurrentTestInfo | ( | unsigned int & | testID, |
| DtFederateHandle & | handle, | ||
| MAKRti::DtTransportType & | transport, | ||
| unsigned int & | payloadSize | ||
| ) | const [virtual] |
the FederateHandle of the current recipient.
References myFedHandleByTestID, myPayloadSize, myTestIDOfCurrentTest, and DtLatencyTest::myTransportByTestID.
Referenced by DtTestManager::tick().
| void DtInitiatorLatencyTest::initiateLatencyTest | ( | unsigned int | trialID, |
| unsigned int | numInteractions, | ||
| unsigned int | sizeOfPayload, | ||
| MAKRti::DtTime | periodBetweenSends, | ||
| DtFederateHandle | handle | ||
| ) | [virtual] |
Initiate a Latency Test.
References DtRIDParameters::DtFomTransportTypeUseBestEffort, myLatencyInterval, myNextSend, myNumberOfInteractionsLeftByFederate, myNumTestsToAverage, myPayloadSize, DtLatencyTest::myTestManager, DtTestManager::params(), DtTestManager::time(), and DtRIDParameters::useRtiExec.
Referenced by DtTestManager::initiateLatencyTest().
| DtInitiatorLatencyTest& DtInitiatorLatencyTest::operator= | ( | DtInitiatorLatencyTest const & | orig | ) | [private] |
Assignment operator - not allowed.
| bool DtInitiatorLatencyTest::takeCompletedTestReport | ( | unsigned int | trialID, |
| DtAveragedLatencyTestReport & | takenReport | ||
| ) | [virtual] |
References averageReports(), DtTestManager::connectMgr(), DtConnectionMgr::fedHandle(), DtTestManager::fedMgr(), DtFederateMgr::fedType(), getCompletedReportByTestID(), myFedHandleByTestID, myRecipientHostInfoMap, myTestIDsByTrial, DtLatencyTest::myTestManager, DtLatencyTest::myTransportByTestID, DtTestManager::params(), DtRIDParameters::processingModel(), and testIsFinished().
Referenced by DtTestManager::processLatencyTest().
| bool DtInitiatorLatencyTest::testIsFinished | ( | unsigned int | testID | ) | const [virtual] |
Query whether this test is finished.
References myInitiatedTestIDs, and DtLatencyTest::myTestsInProgressTimeStamps.
Referenced by DtTestManager::receiveInteraction(), and takeCompletedTestReport().
| bool DtInitiatorLatencyTest::tick | ( | ) | [virtual] |
Process test activities.
Reimplemented from DtLatencyTest.
References consumeTestId(), currTestId(), myFedHandleByTestID, myInitiatedTestIDs, myLatencyInterval, myNextSend, myNumberOfInteractionsLeftByFederate, myTestIDOfCurrentTest, myTestIDsByTrial, DtLatencyTest::myTestManager, DtLatencyTest::myTransportByTestID, and DtTestManager::time().
Referenced by DtTestManager::tick().
| bool DtInitiatorLatencyTest::trialIsFinished | ( | unsigned int | trialID | ) | const [virtual] |
Is the trial finished.
References myNumberOfInteractionsLeftByFederate.
Referenced by DtTestManager::processLatencyTest().
Referenced by addReceiveInteractionTimeStamp(), and getCompletedReportByTestID().
std::map<unsigned int, DtFederateHandle> DtInitiatorLatencyTest::myFedHandleByTestID [protected] |
Referenced by addNetReceiveTimeStamp(), getCompletedReportByTestID(), getCurrentTestInfo(), takeCompletedTestReport(), and tick().
std::set<unsigned int> DtInitiatorLatencyTest::myInitiatedTestIDs [protected] |
Set of known tests are not removed when the test is finished.
myInitiatedTestIds is populated with all initiated test Ids
Referenced by testIsFinished(), and tick().
MAKRti::DtTime DtInitiatorLatencyTest::myLatencyInterval [protected] |
When running a latency test, what is the interval between the myNumTestsToAverage interactions.
This should be greater than the expected round trip latency interaction time.
Referenced by initiateLatencyTest(), and tick().
MAKRti::DtTime DtInitiatorLatencyTest::myNextSend [protected] |
Referenced by initiateLatencyTest(), and tick().
std::map<unsigned int, DtFedHandleToTestMap> DtInitiatorLatencyTest::myNumberOfInteractionsLeftByFederate [protected] |
Map between trialIdentifier and federates involved in current trial and the number of Test Interactions we still have to send to each of them.
Referenced by canInitiateTest(), initiateLatencyTest(), tick(), and trialIsFinished().
unsigned int DtInitiatorLatencyTest::myNumTestsToAverage [protected] |
When running a latency test we will average results from myNumTestsToAverage latency interactions.
Referenced by initiateLatencyTest().
unsigned int DtInitiatorLatencyTest::myPayloadSize [protected] |
When running a latency test, what is the size of the payload attached to interactions in bytes.
Referenced by getCompletedReportByTestID(), getCurrentTestInfo(), and initiateLatencyTest().
std::map<unsigned int, DtRIDParameters::DtAsynchronousIOModeEnum> DtInitiatorLatencyTest::myRecipientAsyncIOModeByFedHandle [protected] |
What is the asynchronous processing mode of the recipient federate by FedHandle.
std::map<unsigned int, DtRtiMtdFederateHostInformation::DtFederateHostInformation> DtInitiatorLatencyTest::myRecipientHostInfoMap [protected] |
Map between federate handle and federate Information.
Referenced by addNetReceiveTimeStamp(), getCompletedReportByTestID(), and takeCompletedTestReport().
unsigned int DtInitiatorLatencyTest::myTestIDOfCurrentTest [protected] |
Referenced by getCurrentTestInfo(), and tick().
std::map<unsigned int, std::set<unsigned int> > DtInitiatorLatencyTest::myTestIDsByTrial [protected] |
Map between trialIdentifer and testIDs associated with the trial.
Referenced by takeCompletedTestReport(), and tick().
unsigned short DtInitiatorLatencyTest::myTestOffset [protected] |
Referenced by consumeTestId(), and currTestId().