Coder Social home page Coder Social logo

bjlaub / simpletsdb-client Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 3.0 3.39 MB

An extremely simple telnet-style C++ client for OpenTSDB using Boost.Asio

License: Boost Software License 1.0

C++ 99.41% Perl 0.04% Graphviz (DOT) 0.03% XSLT 0.34% Shell 0.18%

simpletsdb-client's Introduction

simpletsdb-client 0.1

This is a dead-simple C++ telnet-style client for OpenTSDB, using Boost.Asio.

The client is self-contained in a single class (see SimpleTSDBClient.hh). Typical usage is as follows

simpletsdb::SimpleTSDBClient client(host, port);

// call client.run() in a separate thread
std::thread t(
    boost::bind(
        &simpletsdb::SimpleTSDBClient::run, &client));

// feed some data points to the tsd
simpletsdb::SimpleTSDBClient::TagsType tags;
tags["foo"] = "bar";
tags["bar"] = "baz";
client.add_point("my_metric", timestamp, 123.456, &tags);

// close the client and wait for worker thread
client.close();
t.join();

Building

A sample program (test_client.cc) is included, plus a Makefile demonstrating how to compile.

SimpleTSDBClient relies on Boost.Asio to build. All required Boost libraries are included in the third_party directory, but note that Boost.Asio depends on Boost.System library, which is not header-only. You have two options for integrating SimpleTSDBClient with your code:

  1. cd into third_party/boost and run ./bjam to build the Boost libraries. You can then link against them directly, and distribute as you like
  2. Include third_party/boost/libs/system/src/error_code.cpp in your compilation (this is what the included Makefile does)

Alternatively, you can use your OS's Boost distribution. On Ubuntu:

sudo apt-get install libboost-dev

Notes on included libraries

Included are full copies of Boost.Asio and its dependencies from Boost 1.53.0. Note that Boost 1.54.0 has a bug in Asio (see https://svn.boost.org/trac/boost/ticket/8795) which is the reason for including the older build of Asio.

simpletsdb-client's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.