33 const bool use_detection =
false;
35 std::vector<std::string> splitted;
39 .FlatMap<std::pair<time_t, double> >(
42 if (splitted[0] !=
"time") {
43 time_t timet = std::stod(splitted[0]);
44 struct tm* tmstr = std::localtime(&timet);
45 double temp = std::stod(splitted[1]);
46 size_t time = 24 * tmstr->tm_yday + tmstr->tm_hour;
47 emit(std::make_pair(time, temp));
53 [](
auto& r, std::size_t) {
54 std::vector<double> all;
58 all.push_back(next.second);
61 std::sort(std::begin(all), std::end(all));
62 return std::make_pair(time, all[all.size() / 2 - 1]);
66 [](std::pair<time_t, double> input) {
73 temps.GroupByKey<std::pair<size_t, double> >(
75 time_keyfn, median_fn).Size();
82 LOG1 <<
"RESULT " <<
"benchmark=median " <<
"detection=ON" 88 LOG1 <<
"RESULT " <<
"benchmark=median " <<
"detection=OFF" 96 int main(
int argc,
char* argv[]) {
102 "input file pattern");
104 if (!clp.
process(argc, argv)) {
net::FlowControlChannel & net
size_t num_hosts() const
Returns the total number of hosts.
int Run(const std::function< void(Context &)> &job_startpoint)
Runs the given job startpoint with a Context instance.
void Barrier()
A trivial global barrier.
int main(int argc, char *argv[])
The Context of a job is a unique instance per worker which holds references to all underlying parts o...
DIA< std::string > ReadLines(Context &ctx, const std::string &filepath)
ReadLines is a DOp, which reads a file from the file system and creates an ordered DIA according to a...
std::vector< std::string > split(char sep, const std::string &str, std::string::size_type limit)
Split the given string at each separator character into distinct substrings.
void print_result(std::ostream &os)
print nicely formatted result of processing
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
Command line parser which automatically fills variables and prints nice usage messages.
void add_param_string(const std::string &name, std::string &dest, const std::string &desc)
add string parameter [name] with description and store to dest
net::Traffic Traffic() const
calculate overall traffic for final stats
size_t my_rank() const
Global rank of this worker among all other workers in the system.
void Percentiles(api::Context &ctx, const std::string &input_path)
net::Manager & net_manager()
tag structure for GroupByKey(), and InnerJoin()
bool process(int argc, const char *const *argv, std::ostream &os)