Skip to content

agents,src: cleanup included headers #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions agents/otlp/src/datadog_metrics.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "datadog_metrics.h"

#include <algorithm>

#include "asserts-cpp/asserts.h"
#include "datadog_metrics.h"
#include "http_client.h"

using ProcessMetricsStor = node::nsolid::ProcessMetrics::MetricsStor;
using ThreadMetricsStor = node::nsolid::ThreadMetrics::MetricsStor;
Expand Down
3 changes: 2 additions & 1 deletion agents/otlp/src/datadog_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
#define AGENTS_OTLP_SRC_DATADOG_METRICS_H_

#include "metrics_exporter.h"
#include "http_client.h"
#include "nlohmann/json.h"

namespace node {
namespace nsolid {
namespace otlp {

class OTLPHttpClient;

class DatadogMetrics final: public MetricsExporter {
public:
DatadogMetrics(uv_loop_t* loop,
Expand Down
4 changes: 2 additions & 2 deletions agents/otlp/src/dynatrace_metrics.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "dynatrace_metrics.h"

#include <algorithm>

#include "asserts-cpp/asserts.h"
#include "dynatrace_metrics.h"
#include "http_client.h"

using ProcessMetricsStor = node::nsolid::ProcessMetrics::MetricsStor;
using ThreadMetricsStor = node::nsolid::ThreadMetrics::MetricsStor;
Expand Down
3 changes: 2 additions & 1 deletion agents/otlp/src/dynatrace_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
#define AGENTS_OTLP_SRC_DYNATRACE_METRICS_H_

#include "metrics_exporter.h"
#include "http_client.h"

namespace node {
namespace nsolid {
namespace otlp {

class OTLPHttpClient;

class DynatraceMetrics final: public MetricsExporter {
public:
DynatraceMetrics(uv_loop_t* loop,
Expand Down
2 changes: 1 addition & 1 deletion agents/otlp/src/http_client.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "http_client.h"
#include "debug_utils-inl.h"
#include "asserts-cpp/asserts.h"
#include "debug_utils-inl.h"

namespace node {
namespace nsolid {
Expand Down
3 changes: 2 additions & 1 deletion agents/otlp/src/metrics_exporter.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#ifndef AGENTS_OTLP_SRC_METRICS_EXPORTER_H_
#define AGENTS_OTLP_SRC_METRICS_EXPORTER_H_

#include <nsolid/nsolid_api.h>
#include <utility>
#include <vector>

#include "nsolid.h"

namespace node {
namespace nsolid {
namespace otlp {
Expand Down
1 change: 1 addition & 0 deletions agents/otlp/src/newrelic_metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <algorithm>

#include "asserts-cpp/asserts.h"
#include "http_client.h"

using ProcessMetricsStor = node::nsolid::ProcessMetrics::MetricsStor;
using ThreadMetricsStor = node::nsolid::ThreadMetrics::MetricsStor;
Expand Down
3 changes: 2 additions & 1 deletion agents/otlp/src/newrelic_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
#define AGENTS_OTLP_SRC_NEWRELIC_METRICS_H_

#include "metrics_exporter.h"
#include "http_client.h"
#include "nlohmann/json.h"

namespace node {
namespace nsolid {
namespace otlp {

class OTLPHttpClient;

class NewRelicMetrics final: public MetricsExporter {
public:
NewRelicMetrics(uv_loop_t* loop,
Expand Down
7 changes: 5 additions & 2 deletions agents/otlp/src/otlp_agent.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#include "otlp_agent.h"
#include "debug_utils-inl.h"
#include "asserts-cpp/asserts.h"
#include "datadog_metrics.h"
#include "debug_utils-inl.h"
#include "dynatrace_metrics.h"
#include "metrics_exporter.h"
#include "newrelic_metrics.h"
#include "nsolid/nsolid_util.h"
#include "opentelemetry/exporters/otlp/otlp_http_exporter.h"
#include "opentelemetry/sdk/resource/resource.h"
#include "opentelemetry/sdk/trace/recordable.h"
#include "opentelemetry/exporters/otlp/otlp_http_exporter.h"
#include "opentelemetry/trace/propagation/detail/hex.h"

using ThreadMetricsStor = node::nsolid::ThreadMetrics::MetricsStor;
Expand Down
11 changes: 5 additions & 6 deletions agents/otlp/src/otlp_agent.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#ifndef AGENTS_OTLP_SRC_OTLP_AGENT_H_
#define AGENTS_OTLP_SRC_OTLP_AGENT_H_

#include <nsolid.h>
#include <nsolid/thread_safe.h>
#include <memory>
#include "nlohmann/json.hpp"

#include "asserts-cpp/asserts.h"
#include "metrics_exporter.h"

#include "nlohmann/json.hpp"
#include "nsolid.h"
#include "nsolid/thread_safe.h"

// Class pre-declaration
namespace opentelemetry {
Expand All @@ -27,6 +24,8 @@ namespace nsolid {

namespace otlp {

class MetricsExporter;

struct JSThreadMetrics {
ThreadMetrics metrics_;
ThreadMetrics::MetricsStor prev_;
Expand Down
4 changes: 2 additions & 2 deletions agents/statsd/src/binding.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "node_internals.h"
#include "asserts-cpp/asserts.h"
#include "node_external_reference.h"
#include "node_internals.h"
#include "statsd_agent.h"
#include "util.h"

using v8::Array;
using v8::Context;
Expand Down
8 changes: 2 additions & 6 deletions agents/statsd/src/statsd_agent.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#include <openssl/sha.h>
#include <regex> // NOLINT(build/c++11)
#include <thread> // NOLINT(build/c++11)
#include <tuple>
#include <utility>

#include "statsd_agent.h"
#include "asserts-cpp/asserts.h"
#include "debug_utils-inl.h"
#include "statsd_agent.h"
#include "statsd_endpoint.h"
#include "utils.h"


#define UDP_PACKET_MAX_BYTES 1400

namespace node {
Expand Down
5 changes: 3 additions & 2 deletions agents/statsd/src/statsd_agent.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#ifndef AGENTS_STATSD_SRC_STATSD_AGENT_H_
#define AGENTS_STATSD_SRC_STATSD_AGENT_H_

#include <nsolid/nsolid_api.h>
// NOLINTNEXTLINE(build/c++11)
#include <chrono>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "asserts-cpp/asserts.h"
#include "nlohmann/json.hpp"
#include "nsolid.h"
#include "nsolid/thread_safe.h"
#include "nsuv-inl.h"

#define AGENT_STATUS(X) \
X(Unconfigured, "unconfigured") \
Expand Down
3 changes: 0 additions & 3 deletions agents/statsd/src/statsd_endpoint.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#include <utility>

#include "statsd_endpoint.h"
#include "utils.h"
#include "nsuv-inl.h"

#define STATSD_DEFAULT_HOSTNAME "0.0.0.0"
Expand Down
14 changes: 3 additions & 11 deletions agents/statsd/src/statsd_endpoint.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
#ifndef AGENTS_STATSD_SRC_STATSD_ENDPOINT_H_
#define AGENTS_STATSD_SRC_STATSD_ENDPOINT_H_

#include <algorithm>
#include <memory>
#include <string>
#include <algorithm>
#include <tuple>
#include <vector>

#include "nsolid/nsolid_util.h"
#include "uv.h"
#ifdef USE_LOCAL_NSOLID_DELETE_UNUSED_CONSTRUCTORS
#define NSOLID_DELETE_UNUSED_CONSTRUCTORS(name) \
name(const name&) = delete; \
name(name&&) = delete; \
name& operator=(const name&) = delete; \
name& operator=(name&&) = delete;
#else
#include <nsolid/nsolid_util.h>
#endif

namespace node {
namespace nsolid {
Expand Down
3 changes: 1 addition & 2 deletions agents/zmq/src/binding.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "node_internals.h"
#include "node_external_reference.h"
#include "node_internals.h"
#include "zmq_agent.h"
#include "util.h"

using nlohmann::json;
using v8::Context;
Expand Down
10 changes: 3 additions & 7 deletions agents/zmq/src/zmq_agent.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#include <openssl/sha.h>
// NOLINTNEXTLINE(build/c++11)
#include <thread>
#include <utility>
#include <thread> // NOLINT(build/c++11)

#include "zmq_agent.h"
#include "debug_utils-inl.h"
#include "node_internals.h"
#include "nsolid/nsolid_heap_snapshot.h"
#include "zmq_agent.h"
#include "zmq_endpoint.h"
#include "zmq_errors.h"
#include "nsolid/nsolid_heap_snapshot.h"


namespace node {
namespace nsolid {
Expand Down
10 changes: 6 additions & 4 deletions agents/zmq/src/zmq_agent.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef AGENTS_ZMQ_SRC_ZMQ_AGENT_H_
#define AGENTS_ZMQ_SRC_ZMQ_AGENT_H_

#include <nsolid/nsolid_api.h>
#include <nsolid/nsolid_util.h>
#include <zmq.h>
// NOLINTNEXTLINE(build/c++11)
#include <chrono>
#include <memory>
Expand All @@ -13,8 +10,13 @@
#include <vector>

#include "asserts-cpp/asserts.h"
#include "nlohmann/json.hpp"
#include "http_client.h"
#include "nlohmann/json.hpp"
#include "nsolid.h"
#include "nsolid/nsolid_util.h"
#include "nsolid/thread_safe.h"
#include "nsuv-inl.h"
#include "zmq.h"

#define HANDLE_TYPES(X) \
X(Command, "Command", ZMQ_SUB, "inproc://monitor-command", "command", false, \
Expand Down
10 changes: 2 additions & 8 deletions src/nsolid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@
#include "nsolid/nsolid_heap_snapshot.h"

#include "env-inl.h"
#include "memory_tracker-inl.h"
#include "node_perf.h"
#include "util.h"
#include "uv.h"

#include <chrono> // NOLINT [build/c++11]
#include <cmath>
#include <memory>

#include <chrono> // NOLINT [build/c++11]

#define MICROS_PER_SEC 1000000
#define NANOS_PER_SEC 1000000000
Expand Down
14 changes: 2 additions & 12 deletions src/nsolid/nsolid_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,16 @@

#include <atomic>
#include <functional>
#include <list>
#include <map>
#include <memory>
#include <string>
#include <tuple>
#include <vector>

#include "node.h"
#include "node_snapshotable.h"
#include "nsolid.h"
#include "../../deps/nsuv/include/nsuv-inl.h"
#include "nsolid_util.h"
#include "nsolid_trace.h"
#include "spinlock.h"
#include "thread_safe.h"
#include "v8.h"
// TODO(santigimeno) move json into its own deps folder.
// We can export it via ADDONS_PREREQS in the Makefile and link against it with
// our native module builds that depend on it
#include "nlohmann/json.hpp"
#include "nsolid_util.h"
#include "nsuv-inl.h"

namespace node {
namespace nsolid {
Expand Down
4 changes: 4 additions & 0 deletions src/nsolid/nsolid_heap_snapshot.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#include "nsolid_heap_snapshot.h"
#include "asserts-cpp/asserts.h"
#include "nsolid/nsolid_api.h"
#include "nsolid/nsolid_output_stream.h"
#include "v8-profiler.h"

namespace node {
namespace nsolid {
Expand Down
14 changes: 4 additions & 10 deletions src/nsolid/nsolid_heap_snapshot.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
#ifndef SRC_NSOLID_NSOLID_HEAP_SNAPSHOT_H_
#define SRC_NSOLID_NSOLID_HEAP_SNAPSHOT_H_

#include <v8.h>
#include <v8-profiler.h>
#include <nsolid/nsolid_api.h>
#include <nsolid/nsolid_output_stream.h>
#include <new>
#include <set>
#include <tuple>

#include "asserts-cpp/asserts.h"
#include "nlohmann/json.hpp"
#include <map>
#include "nsolid.h"
#include "nsolid/nsolid_util.h"
#include "nsuv-inl.h"

namespace node {
namespace nsolid {
Expand Down
5 changes: 3 additions & 2 deletions src/nsolid/nsolid_output_stream.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef SRC_NSOLID_NSOLID_OUTPUT_STREAM_H_
#define SRC_NSOLID_NSOLID_OUTPUT_STREAM_H_

#include <v8.h>
#include <v8-profiler.h>
#include <string>

#include "v8-profiler.h"

namespace node {
namespace nsolid {
Expand Down
5 changes: 2 additions & 3 deletions src/nsolid/nsolid_trace.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include "nsolid_api.h"
#include "nsolid_trace.h"
#include "nsolid_util.h"
#include "env-inl.h"
#include "node_internals.h"
#include "nsolid_api.h"
#include "nsolid_util.h"

#define NANOS_PER_SEC 1000000000

Expand Down
6 changes: 2 additions & 4 deletions src/nsolid/nsolid_trace.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#ifndef SRC_NSOLID_NSOLID_TRACE_H_
#define SRC_NSOLID_NSOLID_TRACE_H_

#include <array>
#include <cstdint>
#include <atomic>
#include <memory>
#include <string>
#include <vector>

#include "lru_map.h"
#include "nsolid.h"
#include "thread_safe.h"
#include "nsolid/thread_safe.h"

namespace node {
namespace nsolid {
Expand Down