proc_stats.h
1 // Copyright 2013, Beeri 15. All rights reserved.
2 // Author: Roman Gershman (romange@gmail.com)
3 //
4 #ifndef PROC_STATUS_H
5 #define PROC_STATUS_H
6 
7 #include <ostream>
8 
9 #include "base/integral_types.h"
10 
11 namespace util {
12 
13 struct ProcessStats {
14  uint32 vm_peak = 0;
15  uint32 vm_rss = 0;
16  uint32 vm_size = 0;
17 
18  // Start time of the process in seconds since epoch.
19  uint64 start_time_seconds = 0;
20 
21  static ProcessStats Read();
22 };
23 
24 namespace sys {
25  unsigned int NumCPUs();
26 } // namespace sys
27 
28 } // namespace util
29 
30 std::ostream& operator<<(std::ostream& os, const util::ProcessStats& stats);
31 
32 #endif // PROC_STATUS_H