Giter Site home page Giter Site logo

riemannpp's People

Contributors

cjgdev avatar jengelh avatar

Watchers

 avatar

riemannpp's Issues

error while running rienamm c++ program

#include <riemannpp/riemannpp.hpp>
#include

namespace rpp = riemannpp;
using namespace std;

int main() {
try {
rpp::client client(rpp::client_type::tcp, "localhost", 5555);

	rpp::event e;
	e << make_tuple(rpp::event_field::host,    "localhost")
	  << make_tuple(rpp::event_field::service, "demo-client")
	  << make_tuple(rpp::event_field::state,   "ok");
	client << e;
} catch (rpp::internal_exception &e) {
	std::cerr << "Error: " << e.error() << " - " << e.reason() << "." << std::endl;
	exit (EXIT_FAILURE);
}
return (EXIT_SUCCESS);

}

can any one me how can i run this program by using rienamm c++ client

Adding attributes to events causes SIGSEGV

The following code will result in a SIGSEGV:
rpp::event e;
e.attribute_add(rpp::attribute("x-client", "riemannpp")); // Responsible for causing the fault
rpp::client client(type, "localhost", 5555);
client << std::move(e); // SIGSEGV

Possible memory leak

After running some work in progress code which uses a riemannpp::client to send a large volume of messages to a riemann server through valgrind, I found a memory leak where riemann messages are never freed.

The riemannpp::client::send function calls the riemann-client's riemann_client_send_message function and releases ownership of message object. The riemann_client_send_message function does not free the message before returning, leading to lost memory. The message is passed to riemannpp::client::send as an rvalue so the API user cannot handle freeing the memory.

at client.cpp:80 :

client::send(message&& m) {
    int result = riemann_client_send_message(d_client, m.release()); // Responsible for the memory leak

I switched to using riemannpp::client::send_oneshot which calls the riemann-client riemann_client_send_message_oneshot function which eliminates the memory leak. From the riemann-c-client API doc:

The second function, riemann_client_send_message_oneshot() will also free the message before returning. Be aware that the message will be freed even if the send did not succeed!

The riemannpp::client::send function should take an lvalue reference to the message to better match the behavior of the riemann-client's riemann_client_send_message function it wraps.

riemannpp command line client

riemannpp version 0.1.0
protobuf-c 1.3.1
libprotoc 3.6.1
riemann-0.3.1

when I uses ( riemannpp send -s ok -S "client service" -D "simple cli command" ) this command it is working fine but it does not reflect in riemann log file or dashboard

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.