Google format

This commit is contained in:
Ian Gulliver
2019-05-18 12:16:19 -07:00
parent a70d79e869
commit e03b7da056
4 changed files with 232 additions and 72 deletions

36
usage.h
View File

@@ -1,31 +1,31 @@
#pragma once
#include <sys/resource.h>
#include <chrono>
#include <string>
#include <sys/resource.h>
namespace fireusage {
class UsageTracker {
public:
void AddEvents(uint64_t num);
void AddEvent();
public:
void AddEvents(uint64_t num);
void AddEvent();
void Start();
void Stop();
void Log(const std::string_view& title="");
void Start();
void Stop();
void Log(const std::string_view& title = "");
private:
bool running_ = false;
uint64_t events_ = 0;
std::chrono::nanoseconds wall_time_;
std::chrono::nanoseconds user_time_;
std::chrono::nanoseconds sys_time_;
uint64_t vol_ctxt_sw_ = 0;
uint64_t invol_ctxt_sw_ = 0;
private:
bool running_ = false;
uint64_t events_ = 0;
std::chrono::nanoseconds wall_time_;
std::chrono::nanoseconds user_time_;
std::chrono::nanoseconds sys_time_;
uint64_t vol_ctxt_sw_ = 0;
uint64_t invol_ctxt_sw_ = 0;
std::chrono::steady_clock::time_point start_time_;
rusage start_usage_;
std::chrono::steady_clock::time_point start_time_;
rusage start_usage_;
};
} // namespace fireusage
} // namespace fireusage