Skip to content

Commit

Permalink
* Updated default read hertz thread rate to be more reasonable (1khz,…
Browse files Browse the repository at this point in the history
… rather than infinite hertz)

* Updated network_profiler to set default hertz rate to infinite
* Removed warning that is happening in CheckpointPlayer due to comparison between signed/unsigned
  • Loading branch information
jredmondson committed Feb 11, 2019
1 parent a60bd8d commit fcb1e6c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/madara/knowledge/CheckpointPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ std::pair<std::string, KnowledgeRecord> CheckpointReader::next()
size_t bytes = checkpoint_size;

// if bytes is larger than the existing buffer size
if(bytes > max_buffer)
if(bytes > (size_t)max_buffer)
{
madara_logger_ptr_log(logger_, logger::LOG_MINOR,
"CheckpointReader::next:"
Expand Down
2 changes: 1 addition & 1 deletion include/madara/transport/TransportSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class MADARA_EXPORT TransportSettings
* Number of valid messages allowed to be received per second. This
* value can be -1 or 0.0 to go as fast as possible
**/
double read_thread_hertz = 0.0;
double read_thread_hertz = 1000.0;

/**
* Maximum rate of sending messages. This is not a bandwidth limit.
Expand Down
12 changes: 12 additions & 0 deletions tests/transports/network_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ void handle_arguments(int argc, char** argv)
{
settings.send_reduced_message_header = true;
}
else if(arg1 == "-rhz" || arg1 == "--read-hz")
{
if(i + 1 < argc)
{
std::stringstream buffer(argv[i + 1]);
buffer >> settings.read_thread_hertz;
}

++i;
}
else if (arg1 == "-s" || arg1 == "--size")
{
if (i + 1 < argc)
Expand Down Expand Up @@ -284,6 +294,7 @@ void handle_arguments(int argc, char** argv)
"(def:localhost)\n"
" [-q|--queue-length len the buffer size to use for the test\n"
" [-r|--reduced] use the reduced message header\n"
" [-rhz|--read-hz hz] hertz rate of read threads\n"
" [-s|--size size] size of data packet to send in bytes\n"
" [-ssl|--ssl password] encrypt/decrypt with 256bit AES\n"
" [--send-hz hertz] hertz to send at\n"
Expand Down Expand Up @@ -353,6 +364,7 @@ int main(int argc, char** argv)
// initialize settings
settings.type = transport::MULTICAST;
settings.queue_length = 1000000;
settings.read_thread_hertz = 0.0; // infinite default hertz

// parse the user command line arguments
handle_arguments(argc, argv);
Expand Down

0 comments on commit fcb1e6c

Please sign in to comment.