Skip to content
Merged
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
6 changes: 5 additions & 1 deletion plugins/stats_over_http/stats_over_http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
#include <brotli/encode.h>
#endif

#include "tscore/ink_hrtime.h"

#define PLUGIN_NAME "stats_over_http"
#define FREE_TMOUT 300000
#define STR_BUFFER_SIZE 1024
Expand Down Expand Up @@ -411,12 +413,13 @@ json_out_stats(stats_state *my_state)
{
const char *version;
APPEND("{ \"global\": {\n");

TSRecordDump((TSRecordType)(TS_RECORDTYPE_PLUGIN | TS_RECORDTYPE_NODE | TS_RECORDTYPE_PROCESS), json_out_stat, my_state);
version = TSTrafficServerVersionGet();
APPEND_STAT_JSON_NUMERIC("current_time_epoch_ms", "%" PRIu64, ink_hrtime_to_msec(ink_get_hrtime_internal()));
APPEND("\"server\": \"");
APPEND(version);
APPEND("\"\n");

APPEND(" }\n}\n");
}

Expand Down Expand Up @@ -491,6 +494,7 @@ csv_out_stats(stats_state *my_state)
{
TSRecordDump((TSRecordType)(TS_RECORDTYPE_PLUGIN | TS_RECORDTYPE_NODE | TS_RECORDTYPE_PROCESS), csv_out_stat, my_state);
const char *version = TSTrafficServerVersionGet();
APPEND_STAT_CSV_NUMERIC("current_time_epoch_ms", "%" PRIu64, ink_hrtime_to_msec(ink_get_hrtime_internal()));
APPEND_STAT_CSV("version", "%s", version);
}

Expand Down