Skip to content

Commit

Permalink
fixup! inspector: implement --heap-prof
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed May 20, 2019
1 parent 5e3c173 commit da3cfad
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ added: REPLACEME
> Stability: 1 - Experimental
Specify the average sampling interval in bytes for the heap profiles generated
by `--heap-prof`. The default is 32 * 1024 bytes.
by `--heap-prof`. The default is 512 * 1024 bytes.

### `--heap-prof-name`
<!-- YAML
Expand Down
2 changes: 1 addition & 1 deletion doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ will be placed.
The average sampling interval in bytes for the heap profiles generated by
.Fl -heap-prof .
The default is
.Sy 32 * 1024 .
.Sy 512 * 1024 .
.
.It Fl -heap-prof-name
File name of the V8 heap profile generated with
Expand Down
3 changes: 1 addition & 2 deletions src/inspector_profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class V8HeapProfilerConnection : public V8ProfilerConnection {
void Start() override;
void End() override;

const char* type() const override { return type_.c_str(); }
const char* type() const override { return "heap"; }
bool ending() const override { return ending_; }

std::string GetDirectory() const override;
Expand All @@ -125,7 +125,6 @@ class V8HeapProfilerConnection : public V8ProfilerConnection {
private:
std::unique_ptr<inspector::InspectorSession> session_;
bool ending_ = false;
std::string type_ = "heap";
};

} // namespace profiler
Expand Down
2 changes: 1 addition & 1 deletion src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
&EnvironmentOptions::heap_prof_dir);
AddOption("--heap-prof-interval",
"specified sampling interval in bytes for the V8 heap "
"profile generated with --heap-prof. (default: 32 * 1024)",
"profile generated with --heap-prof. (default: 512 * 1024)",
&EnvironmentOptions::heap_prof_interval);
#endif // HAVE_INSPECTOR
AddOption("--redirect-warnings",
Expand Down
2 changes: 1 addition & 1 deletion src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class EnvironmentOptions : public Options {
bool cpu_prof = false;
std::string heap_prof_dir;
std::string heap_prof_name;
static const uint64_t kDefaultHeapProfInterval = 32 * 1024;
static const uint64_t kDefaultHeapProfInterval = 512 * 1024;
uint64_t heap_prof_interval = kDefaultHeapProfInterval;
bool heap_prof = false;
#endif // HAVE_INSPECTOR
Expand Down

0 comments on commit da3cfad

Please sign in to comment.