namespace stats {

metrics::gauge size;
metrics::gauge process_time;

void update(const chrono::time_point& timestamp) {
	size.update_statistics(timestamp);
	process_time.update_statistics(timestamp);
}

static void reset() {
	config::metrics::gauge size_opts;
	size_opts.values.tags = statistics::tag::value;

	size = metrics::gauge(size_opts);
	size.set(0);

	config::metrics::gauge process_time_opts;
	process_time_opts.values.tags = statistics::tag::moving_avg;
	process_time_opts.values.moving_interval = chrono::duration(1, chrono::time_unit::SEC);

	process_time = metrics::gauge(process_time_opts);
}

void initialize() {
	reset();
}

void finalize() {
	reset();
}

} // namespace stats
Exemple #2
0
namespace stats {

metrics::gauge dump_time;

void update(const chrono::time_point& timestamp) {
	dump_time.update_statistics(timestamp);
}

static void reset() {
	config::metrics::gauge dump_time_opts;
	dump_time_opts.values.tags = statistics::tag::moving_avg;
	dump_time_opts.values.moving_interval = chrono::duration(1, chrono::time_unit::SEC);

	dump_time = metrics::gauge(dump_time_opts);
}

void initialize() {
	reset();
}

void finalize() {
	reset();
}

} // namespace stats
static void reset() {
	config::metrics::gauge size_opts;
	size_opts.values.tags = statistics::tag::value;

	size = metrics::gauge(size_opts);
	size.set(0);

	config::metrics::gauge process_time_opts;
	process_time_opts.values.tags = statistics::tag::moving_avg;
	process_time_opts.values.moving_interval = chrono::duration(1, chrono::time_unit::SEC);

	process_time = metrics::gauge(process_time_opts);
}
Exemple #4
0
void update(const chrono::time_point& timestamp) {
	dump_time.update_statistics(timestamp);
}
void update(const chrono::time_point& timestamp) {
	size.update_statistics(timestamp);
	process_time.update_statistics(timestamp);
}