Skip to content

Commit

Permalink
* Updated network_profiler.cpp and re-enabled the test
Browse files Browse the repository at this point in the history
* Added test_reasoning_throughput and network_profiler to Travis CI
* Updated ASIO transports to allow for blasting experiments
* Removed network_throughput.cpp as it would have been redundant at the moment
  • Loading branch information
jredmondson committed Jun 16, 2018
1 parent 56da40b commit 14eeea8
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 1,160 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,16 @@ script:
- echo $GAMS_ROOT/scripts/$OS/base_build.sh prereqs $CLANG madara tests $SSL $JAVA $ZMQ $SIMTIME
- $GAMS_ROOT/scripts/$OS/base_build.sh prereqs $CLANG madara tests $SSL $JAVA $ZMQ $SIMTIME
# now run a couple of tests
- echo "Testing basic functionality..."
- $MADARA_ROOT/bin/test_basic_reasoning
- $MADARA_ROOT/bin/test_karl_exceptions
# performance test (useful to see if we've regressed in performance)
- echo "Testing reasoning throughput..."
- $MADARA_ROOT/bin/test_reasoning_throughput
# test UDP Multicast networking performance and connectivity for 60s
- echo "Testing multicast performance..."
- $MADARA_ROOT/bin/network_profiler -i 0 -s 1024 & $MADARA_ROOT/bin/network_profiler -i 0
# test UDP Unicast networking performance and connectivity for 60s
- $MADARA_ROOT/bin/network_profiler -i 0 -s 1024 -u 127.0.0.1:30000 -u 127.0.0.1:30001 & $MADARA_ROOT/bin/network_profiler -i 0 -u 127.0.0.1:30001


17 changes: 0 additions & 17 deletions Tests.mpc
Original file line number Diff line number Diff line change
Expand Up @@ -454,23 +454,6 @@ project (Network_Counter_Filter) : using_madara, no_karl, no_xml, null_lock, usi
}
}

project (Network_Throughput) : using_madara, no_karl, no_xml, null_lock, using_simtime {
exeout = $(MADARA_ROOT)/bin
exename = network_throughput

requires += tests

Documentation_Files {
}

Header_Files {
}

Source_Files {
tests/transports/network_throughput.cpp
}
}

project (Network_Profiler) : using_madara, no_karl, no_xml, null_lock, using_simtime {
exeout = $(MADARA_ROOT)/bin
exename = network_profiler
Expand Down
8 changes: 5 additions & 3 deletions include/madara/transport/BasicASIOTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace madara { namespace transport {

namespace mcast = ip::multicast;

const double BasicASIOTransport::default_read_hertz = 10.0;
//const double BasicASIOTransport::default_read_hertz = 10.0;

BasicASIOTransport::BasicASIOTransport (const std::string & id,
knowledge::ThreadSafeContext & context,
Expand Down Expand Up @@ -222,9 +222,11 @@ BasicASIOTransport::setup_read_threads ()
if (!settings_.no_receiving)
{
double hertz = settings_.read_thread_hertz;
if (hertz <= 0.0)
if (hertz < 0.0)
{
hertz = default_read_hertz;
// we need to maintain backwards compatibility
// people should be capable of bursting reads especially
hertz = 0.0;
}

madara_logger_log (context_.get_logger (), logger::LOG_MAJOR,
Expand Down
48 changes: 48 additions & 0 deletions include/madara/transport/TransportSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,54 @@
namespace containers = madara::knowledge::containers;
typedef madara::knowledge::KnowledgeRecord::Integer Integer;

std::string
madara::transport::types_to_string (int id)
{
if (NO_TRANSPORT == id)
{
return "None";
}
if (SPLICE == id)
{
return "Splice DDS";
}
if (NDDS == id)
{
return "RTI DDS";
}
if (UDP == id)
{
return "UDP";
}
if (TCP == id)
{
return "TCP (unsupported)";
}
if (MULTICAST == id)
{
return "UDP Multicast";
}
if (BROADCAST == id)
{
return "UDP Broadcast";
}
if (REGISTRY_SERVER == id)
{
return "UDP Registry Server";
}
if (REGISTRY_CLIENT == id)
{
return "UDP Registry Client";
}
if (ZMQ == id)
{
return "0MQ";
}

// otherwise, it's a custom transport
return "Custom";
}

madara::transport::TransportSettings::TransportSettings () :
write_domain (DEFAULT_DOMAIN),
read_threads (1),
Expand Down
7 changes: 7 additions & 0 deletions include/madara/transport/TransportSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ namespace madara
VOTE = 20
};

/**
* Converts a transport type enum to a string equivalent
* @param id the id of the type to retrieve
* @return the name of the registered transport
**/
MADARA_EXPORT std::string types_to_string (int id);

/**
* Holds basic transport settings
*/
Expand Down

0 comments on commit 14eeea8

Please sign in to comment.