diff options
author | msmit <msmit@remedy.nl> | 2011-10-06 12:06:35 +0000 |
---|---|---|
committer | msmit <msmit@remedy.nl> | 2011-10-06 12:06:35 +0000 |
commit | 9dce3ceabfec8582ab9a30afaf9423d0d5c7177b (patch) | |
tree | 4e993be75d1e5c00f2dcb39add9d7ea2052a478e /CIAO/connectors/dds4ccm/performance-tests | |
parent | 2721d24299eca700995cdefbe07bcc5ac15fc693 (diff) | |
download | ATCD-9dce3ceabfec8582ab9a30afaf9423d0d5c7177b.tar.gz |
Thu Oct 6 12:07:52 UTC 2011 Marcel Smit <msmit@remedy.nl>
* connectors/dds4ccm/examples/Hello/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/examples/IDL2CPPWrapper/Shapes/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp:
* connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/NDDS_Latency_Sender.cpp:
* connectors/dds4ccm/performance-tests/DDSLatency/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/performance-tests/DDSThroughput/DDS_Sender/Throughput_Sender.cpp:
* connectors/dds4ccm/performance-tests/DDSThroughput/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/performance-tests/Keyed/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/performance-tests/Latency/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/performance-tests/Throughput/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/CSLDeadline/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/CSLQoS/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/CSLSampleRejected/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/CSLUnexpStat/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/CoherentUpdater/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/CoherentWriter/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/Getter/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/KeyedWriter/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/LateBinding/ReadGet/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/ListenManyByMany/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/PSLDeadline/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/PSLSampleLost/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/Proxies/ReadWrite/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/QosProfile/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/QueryCondition/DDS/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/QueryCondition/DDS_OneByOne/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/QueryCondition/Different/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/QueryCondition/ReadGet/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/QueryCondition/TwoQueries/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/Reader/Base/Reader_Test_Base.mpc:
* connectors/dds4ccm/tests/Reader/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/SLManyByMany/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/SLOneByOne/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/UnkeyedWriter/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tutorials/Shapes/Shapes_asm/ports/Shapes_ShapeType_msg.mpc:
Fuzz. Added Id string.
* tests/CIF/Common/CIF_Common.cpp:
Check on orb is not nil.
Diffstat (limited to 'CIAO/connectors/dds4ccm/performance-tests')
8 files changed, 584 insertions, 546 deletions
diff --git a/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp b/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp index c59cf3ae60f..b6a0c8c1a71 100644 --- a/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp +++ b/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/Latency_Sender.cpp @@ -466,237 +466,245 @@ int ACE_TMAIN(int argc, ACE_TCHAR* argv[]) DummyPublisherListener * pub_listener = 0; ::DDS::Publisher * pub = 0; - ACE_Env_Value<int> id (ACE_TEXT("DDS4CCM_DEFAULT_DOMAIN_ID"), domain_id_); - domain_id_ = id; - - if (parse_args (argc, argv) != 0) + try { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Error arguments.\n"))); - return 1; - } + ACE_Env_Value<int> id (ACE_TEXT("DDS4CCM_DEFAULT_DOMAIN_ID"), domain_id_); + domain_id_ = id; - (void) ACE_High_Res_Timer::global_scale_factor (); - ACE_Reactor::instance ()->timer_queue()->gettimeofday (&ACE_High_Res_Timer::gettimeofday_hr); - - /* Create the domain participant */ - DDSDomainParticipant * participant = - DDSDomainParticipantFactory::get_instance()-> - create_participant_with_profile( - domain_id_, - lib_name_, - prof_name_, - 0, - DDS_STATUS_MASK_NONE); - if (!participant) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Sender : Unable to create domain participant.\n"))); - goto clean_exit; - } + if (parse_args (argc, argv) != 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Error arguments.\n"))); + return 1; + } - /* Register type before creating topic */ - type_name = LatencyTestTypeSupport::get_type_name(); - retcode = LatencyTestTypeSupport::register_type (participant, - type_name); - if (retcode != DDS_RETCODE_OK) - { - goto clean_exit; - } + (void) ACE_High_Res_Timer::global_scale_factor (); + ACE_Reactor::instance ()->timer_queue()->gettimeofday (&ACE_High_Res_Timer::gettimeofday_hr); + + /* Create the domain participant */ + DDSDomainParticipant * participant = + DDSDomainParticipantFactory::get_instance()-> + create_participant_with_profile( + domain_id_, + lib_name_, + prof_name_, + 0, + DDS_STATUS_MASK_NONE); + if (!participant) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Sender : Unable to create domain participant.\n"))); + goto clean_exit; + } - send_topic = participant->create_topic_with_profile ( - "send", - type_name, - lib_name_, - prof_name_, - 0, - DDS_STATUS_MASK_NONE); - if (!send_topic) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); - goto clean_exit; - } + /* Register type before creating topic */ + type_name = LatencyTestTypeSupport::get_type_name(); + retcode = LatencyTestTypeSupport::register_type (participant, + type_name); + if (retcode != DDS_RETCODE_OK) + { + goto clean_exit; + } - receive_topic = participant->create_topic_with_profile ( - "receive", - type_name, - lib_name_, - prof_name_, - 0, - DDS_STATUS_MASK_NONE); - if (!receive_topic) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); - goto clean_exit; - } + send_topic = participant->create_topic_with_profile ( + "send", + type_name, + lib_name_, + prof_name_, + 0, + DDS_STATUS_MASK_NONE); + if (!send_topic) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); + goto clean_exit; + } - pub_listener = new DummyPublisherListener (); - pub = participant->create_publisher_with_profile ( - lib_name_, - prof_name_, - 0, - DDS_STATUS_MASK_NONE); + receive_topic = participant->create_topic_with_profile ( + "receive", + type_name, + lib_name_, + prof_name_, + 0, + DDS_STATUS_MASK_NONE); + if (!receive_topic) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); + goto clean_exit; + } - if (!pub) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create publisher.\n"))); - goto clean_exit; - } + pub_listener = new DummyPublisherListener (); + pub = participant->create_publisher_with_profile ( + lib_name_, + prof_name_, + 0, + DDS_STATUS_MASK_NONE); - /* Create the data writer using the publisher */ - data_writer = pub->create_datawriter_with_profile( - send_topic, - lib_name_, - prof_name_, - pub_listener, - DDS_OFFERED_DEADLINE_MISSED_STATUS | - DDS_OFFERED_INCOMPATIBLE_QOS_STATUS | - DDS_RELIABLE_WRITER_CACHE_CHANGED_STATUS | - DDS_RELIABLE_READER_ACTIVITY_CHANGED_STATUS | - DDS_LIVELINESS_LOST_STATUS | - DDS_PUBLICATION_MATCHED_STATUS); - - if (!data_writer) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data writer.\n"))); - goto clean_exit; + if (!pub) { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create publisher.\n"))); + goto clean_exit; } - /* Create a data reader, which will not be used, but is there for - * compatibility with DDS4CCM latency test, where there is always a - * reader and a writer per connector. - */ - if (both_read_write_) - { - dum_data_reader = participant->create_datareader_with_profile( - send_topic, - lib_name_, - prof_name_, - &dum_listener, - DDS_DATA_AVAILABLE_STATUS); - - if (!dum_data_reader ) + /* Create the data writer using the publisher */ + data_writer = pub->create_datawriter_with_profile( + send_topic, + lib_name_, + prof_name_, + pub_listener, + DDS_OFFERED_DEADLINE_MISSED_STATUS | + DDS_OFFERED_INCOMPATIBLE_QOS_STATUS | + DDS_RELIABLE_WRITER_CACHE_CHANGED_STATUS | + DDS_RELIABLE_READER_ACTIVITY_CHANGED_STATUS | + DDS_LIVELINESS_LOST_STATUS | + DDS_PUBLICATION_MATCHED_STATUS); + + if (!data_writer) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create dummy data reader.\n"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data writer.\n"))); goto clean_exit; } - } - - data_reader = participant->create_datareader_with_profile( - receive_topic, - lib_name_, - prof_name_, - &listener, - DDS_DATA_AVAILABLE_STATUS); - if (!data_reader) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data reader.\n"))); - goto clean_exit; - } - /* Create a data writer, which will not be used, but is there for - * compatibility with DDS4CCM latency test, where there is always a - * reader and a writer per connector - */ - if (both_read_write_) - { - dum_data_writer = participant->create_datawriter_with_profile( - receive_topic, - lib_name_, - prof_name_, - 0, - DDS_STATUS_MASK_NONE); - if (!dum_data_writer) + /* Create a data reader, which will not be used, but is there for + * compatibility with DDS4CCM latency test, where there is always a + * reader and a writer per connector. + */ + if (both_read_write_) + { + dum_data_reader = participant->create_datareader_with_profile( + send_topic, + lib_name_, + prof_name_, + &dum_listener, + DDS_DATA_AVAILABLE_STATUS); + + if (!dum_data_reader ) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create dummy data writer.\n"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create dummy data reader.\n"))); goto clean_exit; } - } + } - /* Create data sample for writing */ - instance_ = LatencyTestTypeSupport::create_data (); - if (instance_ == 0) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data sample.\n"))); - goto clean_exit; - } + data_reader = participant->create_datareader_with_profile( + receive_topic, + lib_name_, + prof_name_, + &listener, + DDS_DATA_AVAILABLE_STATUS); + if (!data_reader) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data reader.\n"))); + goto clean_exit; + } + + /* Create a data writer, which will not be used, but is there for + * compatibility with DDS4CCM latency test, where there is always a + * reader and a writer per connector + */ + if (both_read_write_) + { + dum_data_writer = participant->create_datawriter_with_profile( + receive_topic, + lib_name_, + prof_name_, + 0, + DDS_STATUS_MASK_NONE); + if (!dum_data_writer) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create dummy data writer.\n"))); + goto clean_exit; + } + } - init_values(); + /* Create data sample for writing */ + instance_ = LatencyTestTypeSupport::create_data (); + if (instance_ == 0) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data sample.\n"))); + goto clean_exit; + } - test_data_writer_ = LatencyTestDataWriter::narrow (data_writer); - if (!test_data_writer_) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("LatencyTestDataWriter_narrow failed.\n"))); - goto clean_exit; - } + init_values(); - // Sleep a couple seconds to allow discovery to happen - ACE_OS::sleep (5); + test_data_writer_ = LatencyTestDataWriter::narrow (data_writer); + if (!test_data_writer_) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("LatencyTestDataWriter_narrow failed.\n"))); + goto clean_exit; + } - // handle writing of messages - start(); + // Sleep a couple seconds to allow discovery to happen + ACE_OS::sleep (5); - /* --- Clean Up --- */ - ACE_OS::sleep (5); - main_result = 0; + // handle writing of messages + start(); -clean_exit: - const char * read_write_str; - if (both_read_write_) - { - read_write_str = "Used a extra dummy reader and writer per topic."; - } - else - { - read_write_str = "Used a reader for one topic and a writer for other topic."; - } + /* --- Clean Up --- */ + ACE_OS::sleep (5); + main_result = 0; - if((nr_of_runs_ -1) != datalen_idx_) - { - ACE_DEBUG ((LM_DEBUG, "SUMMARY SENDER : %u of %u runs completed.\n" - " Number of messages sent of last run (%u): %u\n" - "%C\n\n", - datalen_idx_, - nr_of_runs_, - datalen_idx_ + 1, - number_of_msg_, - read_write_str)); - } - else - { - ACE_UINT64 test_time_usec = end_time_test_ - start_time_test_; - - double sec = (double)test_time_usec / (1000 * 1000); - ACE_DEBUG ((LM_DEBUG, "TEST successful, number of runs (%u) of " - "%u messages in %3.3f seconds.\n" - "%C\n\n", + clean_exit: + const char * read_write_str; + if (both_read_write_) + { + read_write_str = "Used a extra dummy reader and writer per topic."; + } + else + { + read_write_str = "Used a reader for one topic and a writer for other topic."; + } + + if((nr_of_runs_ -1) != datalen_idx_) + { + ACE_DEBUG ((LM_DEBUG, "SUMMARY SENDER : %u of %u runs completed.\n" + " Number of messages sent of last run (%u): %u\n" + "%C\n\n", + datalen_idx_, nr_of_runs_, + datalen_idx_ + 1, number_of_msg_, - sec, read_write_str)); - } - ACE_DEBUG ((LM_DEBUG, "\tNumber of unexpected events : %u\n", - unexpected_count_)); - if (participant) - { - retcode = participant->delete_contained_entities (); - if (retcode != DDS_RETCODE_OK) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); - main_result = 1; - } - retcode = DDSDomainParticipantFactory::get_instance()-> - delete_participant (participant); - if (retcode != DDS_RETCODE_OK) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); - main_result = 1; - } - } - delete [] datalen_range_; - delete [] duration_times_; - delete pub_listener; - return main_result; + } + else + { + ACE_UINT64 test_time_usec = end_time_test_ - start_time_test_; + + double sec = (double)test_time_usec / (1000 * 1000); + ACE_DEBUG ((LM_DEBUG, "TEST successful, number of runs (%u) of " + "%u messages in %3.3f seconds.\n" + "%C\n\n", + nr_of_runs_, + number_of_msg_, + sec, + read_write_str)); + } + ACE_DEBUG ((LM_DEBUG, "\tNumber of unexpected events : %u\n", + unexpected_count_)); + if (participant) + { + retcode = participant->delete_contained_entities (); + if (retcode != DDS_RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); + main_result = 1; + } + retcode = DDSDomainParticipantFactory::get_instance()-> + delete_participant (participant); + if (retcode != DDS_RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); + main_result = 1; + } + } + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : Unexpected CORBA exception caught :"); + main_result = 1; + } + delete [] datalen_range_; + delete [] duration_times_; + delete pub_listener; + return main_result; } void HelloListener::on_data_available(DDSDataReader *reader) diff --git a/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/NDDS_Latency_Sender.cpp b/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/NDDS_Latency_Sender.cpp index c268a516144..fb193621fce 100644 --- a/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/NDDS_Latency_Sender.cpp +++ b/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/DDS_Sender/NDDS_Latency_Sender.cpp @@ -433,228 +433,240 @@ int ACE_TMAIN(int argc, ACE_TCHAR* argv[]) DummyPublisherListener * pub_listener = 0; ::DDS::Publisher * pub = 0; - ACE_Env_Value<int> id (ACE_TEXT("DDS4CCM_DEFAULT_DOMAIN_ID"), domain_id_); - domain_id_ = id; - - if (parse_args (argc, argv) != 0) + try { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Error arguments.\n"))); - return 1; - } + ACE_Env_Value<int> id (ACE_TEXT("DDS4CCM_DEFAULT_DOMAIN_ID"), domain_id_); + domain_id_ = id; - /* Create the domain participant */ - DDSDomainParticipant * participant = - DDSDomainParticipantFactory::get_instance()-> - create_participant_with_profile( - domain_id_, - lib_name_, - prof_name_, - 0, - DDS_STATUS_MASK_NONE); - if (!participant) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Sender : Unable to create domain participant.\n"))); - goto clean_exit; - } - - /* Register type before creating topic */ - type_name = LatencyTestTypeSupport::get_type_name(); - retcode = LatencyTestTypeSupport::register_type (participant, - type_name); - if (retcode != DDS_RETCODE_OK) - { - goto clean_exit; - } + if (parse_args (argc, argv) != 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Error arguments.\n"))); + return 1; + } - send_topic = participant->create_topic_with_profile ( - "send", - type_name, - lib_name_, - prof_name_, - 0, - DDS_STATUS_MASK_NONE); - if (!send_topic) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); - goto clean_exit; - } + /* Create the domain participant */ + DDSDomainParticipant * participant = + DDSDomainParticipantFactory::get_instance()-> + create_participant_with_profile( + domain_id_, + lib_name_, + prof_name_, + 0, + DDS_STATUS_MASK_NONE); + if (!participant) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Sender : Unable to create domain participant.\n"))); + goto clean_exit; + } - receive_topic = participant->create_topic_with_profile ( - "receive", - type_name, - lib_name_, - prof_name_, - 0, - DDS_STATUS_MASK_NONE); - if (!receive_topic) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); - goto clean_exit; - } + /* Register type before creating topic */ + type_name = LatencyTestTypeSupport::get_type_name(); + retcode = LatencyTestTypeSupport::register_type (participant, + type_name); + if (retcode != DDS_RETCODE_OK) + { + goto clean_exit; + } - pub_listener = new DummyPublisherListener (); - pub = participant->create_publisher_with_profile ( - lib_name_, - prof_name_, - 0, - DDS_STATUS_MASK_NONE); + send_topic = participant->create_topic_with_profile ( + "send", + type_name, + lib_name_, + prof_name_, + 0, + DDS_STATUS_MASK_NONE); + if (!send_topic) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); + goto clean_exit; + } - if (!pub) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create publisher.\n"))); - goto clean_exit; - } + receive_topic = participant->create_topic_with_profile ( + "receive", + type_name, + lib_name_, + prof_name_, + 0, + DDS_STATUS_MASK_NONE); + if (!receive_topic) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); + goto clean_exit; + } - /* Create the data writer using the publisher */ - data_writer = pub->create_datawriter_with_profile( - send_topic, - lib_name_, - prof_name_, - pub_listener, - DDS_OFFERED_DEADLINE_MISSED_STATUS | - DDS_OFFERED_INCOMPATIBLE_QOS_STATUS | - DDS_RELIABLE_WRITER_CACHE_CHANGED_STATUS | - DDS_RELIABLE_READER_ACTIVITY_CHANGED_STATUS | - DDS_LIVELINESS_LOST_STATUS | - DDS_PUBLICATION_MATCHED_STATUS); - if (!data_writer) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data writer.\n"))); - goto clean_exit; - } - - /* Create a data reader, which will not be used, but is there for - * compatibility with DDS4CCM latency test, where there is always a - * reader and a writer per connector. - */ - if (both_read_write_) - { - dum_data_reader = participant->create_datareader_with_profile( - send_topic, + pub_listener = new DummyPublisherListener (); + pub = participant->create_publisher_with_profile ( lib_name_, prof_name_, - &dum_listener, - DDS_DATA_AVAILABLE_STATUS); + 0, + DDS_STATUS_MASK_NONE); - if (!dum_data_reader ) + if (!pub) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create dummy data reader.\n"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create publisher.\n"))); goto clean_exit; } - } - data_reader = participant->create_datareader_with_profile( - receive_topic, + /* Create the data writer using the publisher */ + data_writer = pub->create_datawriter_with_profile( + send_topic, lib_name_, prof_name_, - &listener, - DDS_DATA_AVAILABLE_STATUS); - if (!data_reader) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data reader.\n"))); - goto clean_exit; - } - - /* Create a data writer, which will not be used, but is there for - * compatibility with DDS4CCM latency test, where there is always a - * reader and a writer per connector - */ - if (both_read_write_) - { - dum_data_writer = participant->create_datawriter_with_profile( - receive_topic, - lib_name_, - prof_name_, - 0, - DDS_STATUS_MASK_NONE); - if (!dum_data_writer) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create dummy data writer.\n"))); - goto clean_exit; - } - } - - /* Create data sample for writing */ - instance_ = LatencyTestTypeSupport::create_data (); - if (instance_ == 0) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data sample.\n"))); - goto clean_exit; - } - - init_values(); - - test_data_writer_ = LatencyTestDataWriter::narrow (data_writer); - if (!test_data_writer_) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("LatencyTestDataWriter_narrow failed.\n"))); - goto clean_exit; - } - - // Sleep a couple seconds to allow discovery to happen - ACE_OS::sleep (5); - - // handle writing of messages - start(); - - /* --- Clean Up --- */ - ACE_OS::sleep (5); - main_result = 0; - -clean_exit: - const char * read_write_str = 0; - if (both_read_write_) - { - read_write_str = "Used a extra dummy reader and writer per topic."; - } - else - { - read_write_str = "Used a reader for one topic and a writer for other topic."; - } - - if((nr_of_runs_ -1) != datalen_idx_) - { - ACE_DEBUG ((LM_DEBUG, "SUMMARY SENDER : %u of %u runs completed.\n" - " Number of messages sent of last run (%u): %u\n" - "%C\n\n", - datalen_idx_, - nr_of_runs_, - datalen_idx_ + 1, - number_of_msg_, - read_write_str)); - } - else - { - ACE_DEBUG ((LM_DEBUG, "TEST successful, number of runs (%u) of " - "%u messages.\n" - "%C\n\n", + pub_listener, + DDS_OFFERED_DEADLINE_MISSED_STATUS | + DDS_OFFERED_INCOMPATIBLE_QOS_STATUS | + DDS_RELIABLE_WRITER_CACHE_CHANGED_STATUS | + DDS_RELIABLE_READER_ACTIVITY_CHANGED_STATUS | + DDS_LIVELINESS_LOST_STATUS | + DDS_PUBLICATION_MATCHED_STATUS); + if (!data_writer) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data writer.\n"))); + goto clean_exit; + } + + /* Create a data reader, which will not be used, but is there for + * compatibility with DDS4CCM latency test, where there is always a + * reader and a writer per connector. + */ + if (both_read_write_) + { + dum_data_reader = participant->create_datareader_with_profile( + send_topic, + lib_name_, + prof_name_, + &dum_listener, + DDS_DATA_AVAILABLE_STATUS); + + if (!dum_data_reader ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create dummy data reader.\n"))); + goto clean_exit; + } + } + + data_reader = participant->create_datareader_with_profile( + receive_topic, + lib_name_, + prof_name_, + &listener, + DDS_DATA_AVAILABLE_STATUS); + if (!data_reader) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data reader.\n"))); + goto clean_exit; + } + + /* Create a data writer, which will not be used, but is there for + * compatibility with DDS4CCM latency test, where there is always a + * reader and a writer per connector + */ + if (both_read_write_) + { + dum_data_writer = participant->create_datawriter_with_profile( + receive_topic, + lib_name_, + prof_name_, + 0, + DDS_STATUS_MASK_NONE); + if (!dum_data_writer) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create dummy data writer.\n"))); + goto clean_exit; + } + } + + /* Create data sample for writing */ + instance_ = LatencyTestTypeSupport::create_data (); + if (instance_ == 0) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data sample.\n"))); + goto clean_exit; + } + + init_values(); + + test_data_writer_ = LatencyTestDataWriter::narrow (data_writer); + if (!test_data_writer_) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("LatencyTestDataWriter_narrow failed.\n"))); + goto clean_exit; + } + + // Sleep a couple seconds to allow discovery to happen + ACE_OS::sleep (5); + + // handle writing of messages + start(); + + /* --- Clean Up --- */ + ACE_OS::sleep (5); + main_result = 0; + + clean_exit: + const char * read_write_str = 0; + if (both_read_write_) + { + read_write_str = "Used a extra dummy reader and writer per topic."; + } + else + { + read_write_str = "Used a reader for one topic and a writer for other topic."; + } + + if((nr_of_runs_ -1) != datalen_idx_) + { + ACE_DEBUG ((LM_DEBUG, "SUMMARY SENDER : %u of %u runs completed.\n" + " Number of messages sent of last run (%u): %u\n" + "%C\n\n", + datalen_idx_, nr_of_runs_, + datalen_idx_ + 1, number_of_msg_, read_write_str)); - } - ACE_DEBUG ((LM_DEBUG, "\tNumber of unexpected events : %u\n", - unexpected_count_)); - if (participant) - { - retcode = participant->delete_contained_entities (); - if (retcode != DDS_RETCODE_OK) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); - main_result = 1; - } - retcode = DDSDomainParticipantFactory::get_instance()-> - delete_participant (participant); - if (retcode != DDS_RETCODE_OK) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); - main_result = 1; - } - } - delete [] datalen_range_; - delete [] duration_times_; - delete pub_listener; - return main_result; + } + else + { + ACE_DEBUG ((LM_DEBUG, "TEST successful, number of runs (%u) of " + "%u messages.\n" + "%C\n\n", + nr_of_runs_, + number_of_msg_, + read_write_str)); + } + ACE_DEBUG ((LM_DEBUG, "\tNumber of unexpected events : %u\n", + unexpected_count_)); + if (participant) + { + retcode = participant->delete_contained_entities (); + if (retcode != DDS_RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); + main_result = 1; + } + retcode = DDSDomainParticipantFactory::get_instance()-> + delete_participant (participant); + if (retcode != DDS_RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); + main_result = 1; + } + } + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : Unexpected CORBA exception caught :"); + main_result = 1; + } + + delete [] datalen_range_; + delete [] duration_times_; + delete pub_listener; + + return main_result; } void HelloListener::on_data_available(DDSDataReader *reader) diff --git a/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/descriptors/USER_QOS_PROFILES.xml b/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/descriptors/USER_QOS_PROFILES.xml index 2f2e923b7d0..28360e8bc54 100644 --- a/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/descriptors/USER_QOS_PROFILES.xml +++ b/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/descriptors/USER_QOS_PROFILES.xml @@ -1,3 +1,5 @@ +<!-- $Id$ --> + <?xml version="1.0" encoding="utf-8"?> <!-- diff --git a/CIAO/connectors/dds4ccm/performance-tests/DDSThroughput/DDS_Sender/Throughput_Sender.cpp b/CIAO/connectors/dds4ccm/performance-tests/DDSThroughput/DDS_Sender/Throughput_Sender.cpp index 27520706a94..34f4b66dd63 100644 --- a/CIAO/connectors/dds4ccm/performance-tests/DDSThroughput/DDS_Sender/Throughput_Sender.cpp +++ b/CIAO/connectors/dds4ccm/performance-tests/DDSThroughput/DDS_Sender/Throughput_Sender.cpp @@ -158,162 +158,170 @@ CORBA::UShort domain_id = 0; int main_result = 1; /* error by default */ - ACE_Env_Value<int> id (ACE_TEXT("DDS4CCM_DEFAULT_DOMAIN_ID"), domain_id); - domain_id = id; + try + { + ACE_Env_Value<int> id (ACE_TEXT("DDS4CCM_DEFAULT_DOMAIN_ID"), domain_id); + domain_id = id; - if (parse_args (argc, argv) != 0) - return 1; + if (parse_args (argc, argv) != 0) + return 1; - /* Create the domain participant */ - ::DDS::DomainParticipant *participant = - ::DDS::DomainParticipantFactory::get_instance()-> - create_participant_with_profile( - domain_id, /* Domain ID */ - lib_name, - part_name, /* QoS */ - 0, /* Listener */ - DDS_STATUS_MASK_NONE); - if (!participant) { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Unable to create domain participant.\n"))); - goto clean_exit; - } + /* Create the domain participant */ + ::DDS::DomainParticipant *participant = + ::DDS::DomainParticipantFactory::get_instance()-> + create_participant_with_profile( + domain_id, /* Domain ID */ + lib_name, + part_name, /* QoS */ + 0, /* Listener */ + DDS_STATUS_MASK_NONE); + if (!participant) { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Unable to create domain participant.\n"))); + goto clean_exit; + } - /* Register type before creating topic */ - type_name = ThroughputTestTypeSupport::get_type_name(); - retcode = ThroughputTestTypeSupport::register_type( - participant, type_name); - if (retcode != DDS_RETCODE_OK) - { - goto clean_exit; - } - topic = participant->create_topic( - "Test data", /* Topic name*/ - type_name, /* Type name */ - DDS_TOPIC_QOS_DEFAULT, /* Topic QoS */ - 0, /* Listener */ - DDS_STATUS_MASK_NONE); + /* Register type before creating topic */ + type_name = ThroughputTestTypeSupport::get_type_name(); + retcode = ThroughputTestTypeSupport::register_type( + participant, type_name); + if (retcode != DDS_RETCODE_OK) + { + goto clean_exit; + } + topic = participant->create_topic( + "Test data", /* Topic name*/ + type_name, /* Type name */ + DDS_TOPIC_QOS_DEFAULT, /* Topic QoS */ + 0, /* Listener */ + DDS_STATUS_MASK_NONE); - if (!topic) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); - goto clean_exit; - } + if (!topic) { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); + goto clean_exit; + } - /* Register type before creating topic */ - type_name_cmd = ThroughputCommandTypeSupport::get_type_name(); - retcode = ThroughputCommandTypeSupport::register_type( - participant, type_name_cmd); - if (retcode != DDS_RETCODE_OK) - { - goto clean_exit; - } - /* Create the topic "Command World" for the String type */ - cmd_topic = participant->create_topic("Command data", /* Topic name*/ - type_name_cmd , /* Type name */ - DDS_TOPIC_QOS_DEFAULT,/* Topic QoS */ - 0, /* Listener */ - DDS_STATUS_MASK_NONE); - if (!topic) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); - goto clean_exit; - } + /* Register type before creating topic */ + type_name_cmd = ThroughputCommandTypeSupport::get_type_name(); + retcode = ThroughputCommandTypeSupport::register_type( + participant, type_name_cmd); + if (retcode != DDS_RETCODE_OK) + { + goto clean_exit; + } + /* Create the topic "Command World" for the String type */ + cmd_topic = participant->create_topic("Command data", /* Topic name*/ + type_name_cmd , /* Type name */ + DDS_TOPIC_QOS_DEFAULT,/* Topic QoS */ + 0, /* Listener */ + DDS_STATUS_MASK_NONE); + if (!topic) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create topic.\n"))); + goto clean_exit; + } - /* Create the command writer using the default publisher */ - cmd_writer = participant->create_datawriter_with_profile( - cmd_topic, - lib_name, - cmd_prof_name, /* QoS */ - 0, /* Listener */ - DDS_STATUS_MASK_NONE); - if (!cmd_writer) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Unable to create cmd data writer.\n"))); - goto clean_exit; - } + /* Create the command writer using the default publisher */ + cmd_writer = participant->create_datawriter_with_profile( + cmd_topic, + lib_name, + cmd_prof_name, /* QoS */ + 0, /* Listener */ + DDS_STATUS_MASK_NONE); + if (!cmd_writer) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Unable to create cmd data writer.\n"))); + goto clean_exit; + } - /* Create the data writer using the default publisher */ - data_writer = participant->create_datawriter_with_profile( - topic, - lib_name, - prof_name, /* QoS */ - 0, /* Listener */ - DDS_STATUS_MASK_NONE); - if (!data_writer) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data writer.\n"))); - goto clean_exit; - } + /* Create the data writer using the default publisher */ + data_writer = participant->create_datawriter_with_profile( + topic, + lib_name, + prof_name, /* QoS */ + 0, /* Listener */ + DDS_STATUS_MASK_NONE); + if (!data_writer) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data writer.\n"))); + goto clean_exit; + } - /* Create data sample for writing */ - instance = ThroughputTestTypeSupport::create_data(); - if (instance == 0) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data sample.\n"))); - goto clean_exit; - } - overhead_size = sizeof(CORBA::ULong) + sizeof(CORBA::ULongLong); - instance->key = 1; - instance->seq_num = 0; - //instance->data.maximum (MAX_DATA_SEQUENCE_LENGTH); - instance->data.length(datalen - overhead_size); + /* Create data sample for writing */ + instance = ThroughputTestTypeSupport::create_data(); + if (instance == 0) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create data sample.\n"))); + goto clean_exit; + } + overhead_size = sizeof(CORBA::ULong) + sizeof(CORBA::ULongLong); + instance->key = 1; + instance->seq_num = 0; + //instance->data.maximum (MAX_DATA_SEQUENCE_LENGTH); + instance->data.length(datalen - overhead_size); - /* Create data sample for writing */ - instance_cmd = ThroughputCommandTypeSupport::create_data(); - if (instance_cmd == 0) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create command sample.\n"))); - goto clean_exit; - } + /* Create data sample for writing */ + instance_cmd = ThroughputCommandTypeSupport::create_data(); + if (instance_cmd == 0) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create command sample.\n"))); + goto clean_exit; + } - /* Perform a safe type-cast from a generic data writer into a - * specific data writer for the types "ThroughputTestDataWriter" - * and "ThroughputCommandDataWriter" - */ - test_data_writer = ThroughputTestDataWriter::narrow(data_writer); - cmd_data_writer = ThroughputCommandDataWriter::narrow(cmd_writer); - if (!test_data_writer || !cmd_data_writer) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("DDS_StringDataWriter_narrow failed.\n"))); - goto clean_exit; - } + /* Perform a safe type-cast from a generic data writer into a + * specific data writer for the types "ThroughputTestDataWriter" + * and "ThroughputCommandDataWriter" + */ + test_data_writer = ThroughputTestDataWriter::narrow(data_writer); + cmd_data_writer = ThroughputCommandDataWriter::narrow(cmd_writer); + if (!test_data_writer || !cmd_data_writer) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("DDS_StringDataWriter_narrow failed.\n"))); + goto clean_exit; + } - // Sleep a couple seconds to allow discovery to happen - ACE_OS::sleep (1); + // Sleep a couple seconds to allow discovery to happen + ACE_OS::sleep (1); - /* --- Write Data ----------------------------------------------------- */ - for(CORBA::ULong i = start_load; i < (max_load + incr_load); i+= incr_load) - { - write(); - ACE_OS::sleep (5); - } + /* --- Write Data ----------------------------------------------------- */ + for(CORBA::ULong i = start_load; i < (max_load + incr_load); i+= incr_load) + { + write(); + ACE_OS::sleep (5); + } - /* --- Clean Up ------------------------------------------------------- */ - ACE_OS::sleep (5); + /* --- Clean Up ------------------------------------------------------- */ + ACE_OS::sleep (5); - main_result = 0; + main_result = 0; clean_exit: - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Exiting."))); - ACE_DEBUG ((LM_DEBUG, "SUMMARY SENDER number of messages sent: %Q\n", - (number_of_msg))); - if (participant) - { - retcode = participant->delete_contained_entities(); - if (retcode != DDS_RETCODE_OK) - { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); - main_result = 1; - } - retcode = ::DDS::DomainParticipantFactory::get_instance()-> - delete_participant(participant); - if (retcode != DDS_RETCODE_OK) + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Exiting."))); + ACE_DEBUG ((LM_DEBUG, "SUMMARY SENDER number of messages sent: %Q\n", + (number_of_msg))); + if (participant) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); - main_result = 1; - } - } + retcode = participant->delete_contained_entities(); + if (retcode != DDS_RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); + main_result = 1; + } + retcode = ::DDS::DomainParticipantFactory::get_instance()-> + delete_participant(participant); + if (retcode != DDS_RETCODE_OK) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Deletion failed.\n"))); + main_result = 1; + } + } + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : Unexpected CORBA exception caught :"); + main_result = 1; + } return main_result; } diff --git a/CIAO/connectors/dds4ccm/performance-tests/DDSThroughput/descriptors/USER_QOS_PROFILES.xml b/CIAO/connectors/dds4ccm/performance-tests/DDSThroughput/descriptors/USER_QOS_PROFILES.xml index 94ab97ccfee..933ac020fe9 100644 --- a/CIAO/connectors/dds4ccm/performance-tests/DDSThroughput/descriptors/USER_QOS_PROFILES.xml +++ b/CIAO/connectors/dds4ccm/performance-tests/DDSThroughput/descriptors/USER_QOS_PROFILES.xml @@ -1,3 +1,5 @@ +<!-- $Id$ --> + <?xml version="1.0" encoding="utf-8"?> <!-- diff --git a/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/USER_QOS_PROFILES.xml b/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/USER_QOS_PROFILES.xml index 75652bdc499..be4f5064484 100644 --- a/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/USER_QOS_PROFILES.xml +++ b/CIAO/connectors/dds4ccm/performance-tests/Keyed/descriptors/USER_QOS_PROFILES.xml @@ -1,3 +1,5 @@ +<!-- $Id$ --> + <?xml version="1.0" encoding="utf-8"?> <!-- diff --git a/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/USER_QOS_PROFILES.xml b/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/USER_QOS_PROFILES.xml index 2f2e923b7d0..28360e8bc54 100644 --- a/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/USER_QOS_PROFILES.xml +++ b/CIAO/connectors/dds4ccm/performance-tests/Latency/descriptors/USER_QOS_PROFILES.xml @@ -1,3 +1,5 @@ +<!-- $Id$ --> + <?xml version="1.0" encoding="utf-8"?> <!-- diff --git a/CIAO/connectors/dds4ccm/performance-tests/Throughput/descriptors/USER_QOS_PROFILES.xml b/CIAO/connectors/dds4ccm/performance-tests/Throughput/descriptors/USER_QOS_PROFILES.xml index 647120542f3..996f86c2848 100644 --- a/CIAO/connectors/dds4ccm/performance-tests/Throughput/descriptors/USER_QOS_PROFILES.xml +++ b/CIAO/connectors/dds4ccm/performance-tests/Throughput/descriptors/USER_QOS_PROFILES.xml @@ -1,3 +1,5 @@ +<!-- $Id$ --> + <?xml version="1.0" encoding="utf-8"?> <!-- |