Skip to content

Commit 1eb5b6c

Browse files
authored
Drop HTTP transport (#124)
* Drop HTTP transport * Use Ubunty xenial in travis
1 parent 0779ac9 commit 1eb5b6c

File tree

10 files changed

+16
-233
lines changed

10 files changed

+16
-233
lines changed

.travis.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
sudo: required
22
language: cpp
3-
dist: trusty
43
matrix:
54
allow_failures:
65
- os: linux
@@ -15,6 +14,7 @@ matrix:
1514
osx_image: xcode10
1615
env: TOOL=test
1716
- os: linux
17+
dist: xenial
1818
env: TOOL=test
1919
addons:
2020
apt:
@@ -24,11 +24,12 @@ matrix:
2424
- gcc-8
2525
- g++-8
2626
- cmake
27-
- libboost-system1.55-dev
28-
- libboost-filesystem1.55-dev
29-
- libboost-test1.55-dev
30-
- libboost-program-options1.55-dev
27+
- libboost-system1.58-dev
28+
- libboost-filesystem1.58-dev
29+
- libboost-test1.58-dev
30+
- libboost-program-options1.58-dev
3131
- os: linux
32+
dist: xenial
3233
env: TOOL=coverage
3334
addons:
3435
apt:
@@ -44,10 +45,10 @@ matrix:
4445
- doxygen-latex
4546
- doxygen-gui
4647
- graphviz
47-
- libboost-system1.55-dev
48-
- libboost-filesystem1.55-dev
49-
- libboost-test1.55-dev
50-
- libboost-program-options1.55-dev
48+
- libboost-system1.58-dev
49+
- libboost-filesystem1.58-dev
50+
- libboost-test1.58-dev
51+
- libboost-program-options1.58-dev
5152
branches:
5253
only:
5354
- dev

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
5353
find_package(Boost REQUIRED COMPONENTS unit_test_framework program_options system filesystem)
5454
find_package(Git QUIET)
5555
find_package(ApMon MODULE)
56-
find_package(CURL REQUIRED MODULE)
5756

5857

5958
####################################
@@ -77,7 +76,6 @@ set(SRCS
7776
src/MonitoringFactory.cxx
7877
src/Transports/UDP.cxx
7978
src/Transports/TCP.cxx
80-
src/Transports/HTTP.cxx
8179
src/Transports/Unix.cxx
8280
src/Exceptions/MonitoringException.cxx
8381
)
@@ -86,7 +84,7 @@ set(SRCS
8684
message(STATUS "Backends")
8785
message(STATUS " Compiling StdCout backend")
8886
message(STATUS " Compiling Flume UDP/JSON backend")
89-
message(STATUS " Compiling InfluxDB HTTP and UDP backend")
87+
message(STATUS " Compiling InfluxDB backend with Unix socket and UDP transport")
9088

9189
# Create library
9290
add_library(Monitoring SHARED ${SRCS} $<$<BOOL:${ApMon_FOUND}>:src/Backends/ApMonBackend.cxx>)
@@ -104,7 +102,6 @@ target_link_libraries(Monitoring
104102
Boost::boost
105103
PRIVATE
106104
Boost::system
107-
CURL::CURL
108105
$<$<BOOL:${ApMon_FOUND}>:ApMon::ApMon>
109106
)
110107

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ See table below to find out how to create `URI` for each backend:
6767
6868
| Backend name | Transport | URI backend[-protocol] | URI query | Default verbosity |
6969
| ------------ |:-----------:|:----------------------:|:----------:| -----------------:|
70-
| InfluxDB | HTTP | `influxdb-http` | `?db=<db>` | `info` |
70+
| No-op | - | `no-op` | | - |
7171
| InfluxDB | UDP | `influxdb-udp` | - | `info` |
7272
| InfluxDB | Unix socket | `influxdb-unix` | - | `info` |
7373
| ApMon | UDP | `apmon` | - | `info` |
74-
| StdOut | - | `stdout`, `infologger` | - | `debug` |
74+
| StdOut | - | `stdout`, `infologger` | [Prefix] | `debug` |
7575
| Flume | UDP | `flume` | - | `info` |
7676
7777
##### StdCout output format

cmake/FindCURL.cmake

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/Backends/InfluxDB.cxx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <boost/lexical_cast.hpp>
88
#include <string>
99
#include "../Transports/UDP.h"
10-
#include "../Transports/HTTP.h"
1110
#include "../Transports/Unix.h"
1211
#include "../Exceptions/MonitoringException.h"
1312

@@ -27,15 +26,6 @@ InfluxDB::InfluxDB(const std::string& host, unsigned int port) :
2726
<< " ("<< host << ":" << port << ")" << MonLogger::End();
2827
}
2928

30-
InfluxDB::InfluxDB(const std::string& host, unsigned int port, const std::string& search)
31-
{
32-
mTransport = std::make_unique<transports::HTTP>(
33-
"http://" + host + ":" + std::to_string(port) + "/write?" + search
34-
);
35-
MonLogger::Get() << "InfluxDB/HTTP backend initialized" << " (" << "http://" << host
36-
<< ":" << std::to_string(port) << "/write?" << search << ")" << MonLogger::End();
37-
}
38-
3929
InfluxDB::InfluxDB(const std::string& socketPath) :
4030
mTransport(std::make_unique<transports::Unix>(socketPath))
4131
{

src/Backends/InfluxDB.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ class InfluxDB final : public Backend
3232
/// \param port InfluxDB UDP endpoint port number
3333
InfluxDB(const std::string& host, unsigned int port);
3434

35-
/// Constructor for HTTP transport
36-
/// \param host InfluxDB HTTP endpoint hostname
37-
/// \param port InfluxDB HTTP endpoint port number
38-
/// \param path Query search providing database name
39-
InfluxDB(const std::string& host, unsigned int port, const std::string& search);
40-
35+
/// Constructor for Unix socket transport
4136
InfluxDB(const std::string& socketPath);
4237

4338
/// Default destructor

src/MonitoringFactory.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ std::unique_ptr<Backend> getInfluxDb(http::url uri) {
4949
if (uri.protocol == "udp") {
5050
return std::make_unique<backends::InfluxDB>(uri.host, uri.port);
5151
}
52-
if (uri.protocol == "http") {
53-
return std::make_unique<backends::InfluxDB>(uri.host, uri.port, uri.search);
54-
}
5552
if (uri.protocol == "unix") {
5653
std::string path = uri.path;;
5754
auto found = std::find_if(begin(verbosities), end(verbosities),
@@ -99,7 +96,6 @@ std::unique_ptr<Backend> MonitoringFactory::GetBackend(std::string& url) {
9996
{"infologger", getStdOut},
10097
{"stdout", getStdOut},
10198
{"influxdb-udp", getInfluxDb},
102-
{"influxdb-http", getInfluxDb},
10399
{"influxdb-unix", getInfluxDb},
104100
{"apmon", getApMon},
105101
{"flume", getFlume},

src/Transports/HTTP.cxx

Lines changed: 0 additions & 70 deletions
This file was deleted.

src/Transports/HTTP.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

test/testMonitoringFactory.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ BOOST_AUTO_TEST_CASE(verbosity)
2828
auto influxDebug = Monitoring::GetBackend(influxDebugUrl);
2929
BOOST_CHECK_EQUAL(static_cast<std::underlying_type<Verbosity>::type>(influxDebug->getVerbosity()), 2);
3030

31-
std::string influxHttpUrl = "influxdb-http://127.0.0.1:1234/?db=test";
32-
auto influxHttp = Monitoring::GetBackend(influxHttpUrl);
31+
std::string influxUnixUrl = "influxdb-unix://127.0.0.1:1234/?db=test";
32+
auto influxHttp = Monitoring::GetBackend(influxUnixUrl);
3333

3434
std::string ilProdUrl = "stdout:///info";
3535
auto ilProd = Monitoring::GetBackend(ilProdUrl);

0 commit comments

Comments
 (0)