Working getrusage and wall clock metrics

This commit is contained in:
flamingcow
2019-05-10 23:04:26 -07:00
parent 187585d02c
commit 13553e1a07
5 changed files with 95 additions and 6 deletions

22
example_loop.cc Normal file
View File

@@ -0,0 +1,22 @@
#include <gflags/gflags.h>
#include <glog/logging.h>
#include "usage.h"
int main(int argc, char *argv[]) {
google::InitGoogleLogging(argv[0]);
gflags::ParseCommandLineFlags(&argc, &argv, true);
fireusage::UsageTracker tracker;
tracker.Start();
for (int i = 0; i < 100000000; ++i) {
tracker.AddEvent();
for (int _ = 0; _ < 100000; ++_) {
}
}
tracker.Stop();
tracker.Log();
gflags::ShutDownCommandLineFlags();
google::ShutdownGoogleLogging();
}