-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #132 Reviewed-BY: hyj1991 <[email protected]>
- Loading branch information
1 parent
f78cd6a
commit 9a931d5
Showing
4 changed files
with
106 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
#ifndef _SRC_COMMANDS_GCPROFILER_GC_PROFILER_H | ||
#define _SRC_COMMANDS_GCPROFILER_GC_PROFILER_H | ||
#ifndef XPROFILER_SRC_COMMANDS_GCPROFILER_GC_PROFILER_H | ||
#define XPROFILER_SRC_COMMANDS_GCPROFILER_GC_PROFILER_H | ||
|
||
#include <string> | ||
|
||
#include "library/writer.h" | ||
#include "nan.h" | ||
|
||
namespace xprofiler { | ||
using std::string; | ||
|
||
class GcProfiler { | ||
public: | ||
GcProfiler(); | ||
virtual ~GcProfiler(); | ||
static void StartGCProfiling(string filename); | ||
static void StopGCProfiling(); | ||
static void StartGCProfiling(v8::Isolate* isolate, std::string filename); | ||
static void StopGCProfiling(v8::Isolate* isolate); | ||
|
||
~GcProfiler(); | ||
|
||
bool is_open() { return outfile_.is_open(); } | ||
JSONWriter* writer() { return &writer_; } | ||
uint64_t init() { return init_; } | ||
|
||
private: | ||
GcProfiler(v8::Isolate* isolate, std::string filename); | ||
|
||
std::string filename_ = ""; | ||
std::ofstream outfile_; | ||
JSONWriter writer_; | ||
uint64_t init_ = 0; | ||
}; | ||
|
||
} // namespace xprofiler | ||
#endif | ||
|
||
#endif /* XPROFILER_SRC_COMMANDS_GCPROFILER_GC_PROFILER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters