memgraph/tests/integration/telemetry/client.cpp
Matija Santl 4c27596fdd Implement kafka transform functionality
Summary:
First iteration in implementing kafka.
Currently, memgraph streams won't use the transform script provided in the
`CREATE STREAM` query.

There is a manual test that serves a POC purpose which we'll use to fully wire
kafka in memgraph.

Since streams need to download the script, I moved curl init from
telemetry.

Reviewers: teon.banek, mferencevic

Reviewed By: mferencevic

Subscribers: ipaljak, pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D1491
2018-07-19 12:52:25 +02:00

32 lines
1.0 KiB
C++

#include <gflags/gflags.h>
#include "requests/requests.hpp"
#include "telemetry/telemetry.hpp"
DEFINE_string(endpoint, "http://127.0.0.1:9000/",
"Endpoint that should be used for the test.");
DEFINE_int64(interval, 1, "Interval used for reporting telemetry in seconds.");
DEFINE_int64(duration, 10, "Duration of the test in seconds.");
DEFINE_string(storage_directory, "",
"Path to the storage directory where to save telemetry data.");
int main(int argc, char **argv) {
gflags::SetVersionString("telemetry");
gflags::ParseCommandLineFlags(&argc, &argv, true);
google::InitGoogleLogging(argv[0]);
requests::Init();
telemetry::Telemetry telemetry(FLAGS_endpoint, FLAGS_storage_directory,
std::chrono::seconds(FLAGS_interval), 1);
uint64_t counter = 0;
telemetry.AddCollector("db", [&counter]() -> nlohmann::json {
++counter;
return {{"vertices", counter}, {"edges", counter}};
});
std::this_thread::sleep_for(std::chrono::seconds(FLAGS_duration));
return 0;
}