aboutsummaryrefslogtreecommitdiff
path: root/src/system-stats/system-stats.cpp
blob: 6a9549caea9852d31097722db181da5a2e3ee5ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <thread>
#include <iostream>

#include "common.h"

using namespace std::literals;

int main()
{
	namespace CH = std::chrono;

	auto logf = LogFile();
	refstream stream = std::ref(std::cout);

	while(1) {
		logf.change(stream);
		auto epoch = CH::duration_cast<CH::seconds>(
		                 CH::system_clock::now().time_since_epoch()
		             ).count();

		stream.get() << "begin\t" << epoch << std::endl;
		stream.get() << dumpReport();
		stream.get() << "end\t" << epoch << std::endl;

		std::this_thread::sleep_for(1min);
	}
	return 0;
}