Skip to content

Commit d9c2288

Browse files
committed
std::time_t
1 parent a92cdf3 commit d9c2288

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/datadog/tracer_telemetry.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ TracerTelemetry::TracerTelemetry(
5555

5656
nlohmann::json TracerTelemetry::generate_telemetry_body(
5757
std::string request_type) {
58-
time_t tracer_time = std::chrono::duration_cast<std::chrono::seconds>(
59-
clock_().wall.time_since_epoch())
60-
.count();
58+
std::time_t tracer_time = std::chrono::duration_cast<std::chrono::seconds>(
59+
clock_().wall.time_since_epoch())
60+
.count();
6161
seq_id_++;
6262
return nlohmann::json::object({
6363
{"api_version", "v2"},
@@ -99,9 +99,9 @@ std::string TracerTelemetry::app_started(nlohmann::json&& tracer_config) {
9999
}
100100

101101
void TracerTelemetry::capture_metrics() {
102-
time_t timepoint = std::chrono::duration_cast<std::chrono::seconds>(
103-
clock_().wall.time_since_epoch())
104-
.count();
102+
std::time_t timepoint = std::chrono::duration_cast<std::chrono::seconds>(
103+
clock_().wall.time_since_epoch())
104+
.count();
105105
for (auto& m : metrics_snapshots_) {
106106
auto value = m.first.get().capture_and_reset_value();
107107
if (value == 0) {

src/datadog/tracer_telemetry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class TracerTelemetry {
8888
} metrics_;
8989
// Each metric has an associated MetricSnapshot that contains the data points,
9090
// represented as a timestamp and the value of that metric.
91-
using MetricSnapshot = std::vector<std::pair<time_t, uint64_t>>;
91+
using MetricSnapshot = std::vector<std::pair<std::time_t, uint64_t>>;
9292
// This uses a reference_wrapper so references to internal metric values can
9393
// be captured, and be iterated trivially when the values need to be
9494
// snapshotted and published in telemetry messages.

0 commit comments

Comments
 (0)