Skip to content

Commit

Permalink
Add output-archive-size parameter to tsclient application.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuveland committed Nov 21, 2016
1 parent 193f6cf commit 93999ab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/tsclient/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ Application::Application(Parameters const& par) : par_(par)
}

if (!par_.output_archive().empty()) {
sinks_.push_back(std::unique_ptr<fles::TimesliceSink>(
new fles::TimesliceOutputArchive(par_.output_archive())));
if (par_.output_archive_size() == SIZE_MAX) {
sinks_.push_back(std::unique_ptr<fles::TimesliceSink>(
new fles::TimesliceOutputArchive(par_.output_archive())));
} else {
sinks_.push_back(std::unique_ptr<fles::TimesliceSink>(
new fles::TimesliceOutputArchiveSequence(
par_.output_archive(), par_.output_archive_size())));
}
}

if (!par_.publish_address().empty()) {
Expand Down
4 changes: 4 additions & 0 deletions app/tsclient/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ void Parameters::parse_options(int argc, char* argv[])
"name of an input file archive to read");
desc_add("output-archive,o", po::value<std::string>(&output_archive_),
"name of an output file archive to write");
desc_add("output-archive-size", po::value<size_t>(&output_archive_size_),
"limit number of timeslices per file to given number, create "
"sequence of output archive files (use placeholder %n in "
"output-archive parameter)");
desc_add("publish,P", po::value<std::string>(&publish_address_)
->implicit_value("tcp://*:5556"),
"enable timeslice publisher on given address");
Expand Down
3 changes: 3 additions & 0 deletions app/tsclient/Parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Parameters

std::string output_archive() const { return output_archive_; }

size_t output_archive_size() const { return output_archive_size_; }

bool analyze() const { return analyze_; }

bool benchmark() const { return benchmark_; }
Expand All @@ -51,6 +53,7 @@ class Parameters
std::string shm_identifier_;
std::string input_archive_;
std::string output_archive_;
size_t output_archive_size_ = SIZE_MAX;
bool analyze_ = false;
bool benchmark_ = false;
size_t verbosity_ = 0;
Expand Down

0 comments on commit 93999ab

Please sign in to comment.