Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 853753b

Browse files
committed
add manual profiling, prebuild all addons
1 parent 3cef3cd commit 853753b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+694
-80
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
._
33
._.*
44
build
5-
prebuilt
65
node_modules
76
npm-debug.log
87
package-lock.json

README.md

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Learn more on the [features](https://stackimpact.com/features/) page (with scree
2121

2222
#### How it works
2323

24-
The StackImpact profiler agent is imported into a program and used as a normal package. When the program runs, various sampling profilers are started and stopped automatically by the agent and/or programmatically using the agent methods. The agent periodically reports recorded profiles and metrics to the StackImpact Dashboard. If an application has multiple processes, also referred to as workers, instances or nodes, only one or two processes will have active agents at any point of time.
24+
The StackImpact profiler agent is imported into a program and used as a normal package. When the program runs, various sampling profilers are started and stopped automatically by the agent and/or programmatically using the agent methods. The agent periodically reports recorded profiles and metrics to the StackImpact Dashboard. If an application has multiple processes, also referred to as workers, instances or nodes, only one or two processes will have active agents at any point of time. The agent can also operate in manual mode, which should be used in development only.
2525

2626

2727
#### Documentation
@@ -34,7 +34,7 @@ See full [documentation](https://stackimpact.com/docs/) for reference.
3434

3535
* Linux, OS X or Windows. Node.js v4.0.0 or higher.
3636
* CPU profiler is disabled by default for Node.js v7.0.0 to v8.9.3 due to memory leak in underlying V8's CPU profiler. To enable, add `cpuProfilerDisabled: false` to startup options.
37-
* Allocation profiler supports Node.js v6.0.0 and higher. The allocation profiler is disabled by default, since V8's heap sampling is still experimental and is seen to result in segmentation faults. To enable, add `allocationProfilerDisabled: false` to startup options.
37+
* Allocation profiler supports Node.js v6.0.0 and higher, but is disabled by default for Node.js v6.0.0 to v8.5.0 due to segfaults. To enable, add `allocationProfilerDisabled: false` to startup options.
3838
* Async profiler supports Node.js v8.1.0 and higher.
3939

4040

@@ -79,18 +79,18 @@ All initialization options:
7979
* `appVersion` (Optional) Sets application version, which can be used to associate profiling information with the source code release.
8080
* `appEnvironment` (Optional) Used to differentiate applications in different environments.
8181
* `hostName` (Optional) By default, host name will be the OS hostname.
82-
* `autoProfiling` (Optional) If set to `false`, disables automatic profiling and reporting. `agent.profile()` and `agent.report(callback)` should be used instead. Useful for environments without support for timers or background tasks.
82+
* `autoProfiling` (Optional) If set to `false`, disables automatic profiling and reporting. Programmatic or manual profiling should be used instead. Useful for environments without support for timers or background tasks.
8383
* `debug` (Optional) Enables debug logging.
8484
* `cpuProfilerDisabled`, `allocationProfilerDisabled`, `asyncProfilerDisabled`, `errorProfilerDisabled` (Optional) Disables respective profiler when `true`.
8585
* `includeAgentFrames` (Optional) Set to `true` to not exclude agent stack frames from profiles.
8686

8787

8888
#### Programmatic profiling
8989

90-
Use `agent.profile()` to instruct the agent when to start and stop profiling. The agent decides if and which profiler is activated. Normally, this method should be used in repeating code, such as request or event handlers. Usage example:
90+
Use `agent.profile(name)` to instruct the agent when to start and stop profiling. The agent decides if and which profiler is activated. Normally, this method should be used in repeating code, such as request or event handlers. In addition to more precise profiling, timing information will also be reported for the profiled spans. Usage example:
9191

9292
```javascript
93-
const span = agent.profile();
93+
const span = agent.profile('span1');
9494

9595
// your code here
9696

@@ -100,6 +100,43 @@ span.stop();
100100
Is no callback is provided, `stop()` method returns a promise.
101101

102102

103+
#### Manual profiling
104+
105+
*Manual profiling should not be used in production!*
106+
107+
By default, the agent starts and stops profiling automatically. Manual profiling allows to start and stop profilers directly. It is suitable for profiling short-lived programs and should not be used for long-running production applications. Automatic profiling should be disabled with `autoProfiling: false`.
108+
109+
```javascript
110+
// Start CPU profiler.
111+
agent.startCpuProfiler();
112+
```
113+
114+
```javascript
115+
// Stop CPU profiler and report the recorded profile to the Dashboard.
116+
agent.stopCpuProfiler(callback);
117+
```
118+
119+
```javascript
120+
// Start async call profiler.
121+
agent.startAsyncProfiler();
122+
```
123+
124+
```javascript
125+
// Stop async call profiler and report the recorded profile to the Dashboard.
126+
agent.stopAsyncProfiler(callback);
127+
```
128+
129+
```javascript
130+
// Start heap allocation profiler.
131+
agent.startAllocationProfiler();
132+
```
133+
134+
```javascript
135+
// Stop heap allocation profiler and report the recorded profile to the Dashboard.
136+
agent.stopAllocationProfiler(callback);
137+
```
138+
139+
103140
#### Shutting down the agent
104141
*Optional*
105142

abi-map.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"v4.0.0":"46","v4.1.0":"46","v4.1.1":"46","v4.1.2":"46","v4.2.0":"46","v4.2.1":"46","v4.2.2":"46","v4.2.3":"46","v4.2.4":"46","v4.2.5":"46","v4.2.6":"46","v4.3.0":"46","v4.3.1":"46","v4.3.2":"46","v4.4.0":"46","v4.4.1":"46","v4.4.2":"46","v4.4.3":"46","v4.4.4":"46","v4.4.5":"46","v4.4.6":"46","v4.4.7":"46","v4.5.0":"46","v4.6.0":"46","v4.6.1":"46","v4.6.2":"46","v4.7.0":"46","v4.7.1":"46","v4.7.2":"46","v4.7.3":"46","v4.8.0":"46","v4.8.1":"46","v4.8.2":"46","v4.8.3":"46","v4.8.4":"46","v5.0.0":"47","v5.1.0":"47","v5.1.1":"47","v5.10.0":"47","v5.10.1":"47","v5.11.0":"47","v5.11.1":"47","v5.12.0":"47","v5.2.0":"47","v5.3.0":"47","v5.4.0":"47","v5.4.1":"47","v5.5.0":"47","v5.6.0":"47","v5.7.0":"47","v5.7.1":"47","v5.8.0":"47","v5.9.0":"47","v5.9.1":"47","v6.0.0":"48","v6.1.0":"48","v6.10.0":"48","v6.10.1":"48","v6.10.2":"48","v6.10.3":"48","v6.11.0":"48","v6.11.1":"48","v6.11.2":"48","v6.2.0":"48","v6.2.1":"48","v6.2.2":"48","v6.3.0":"48","v6.3.1":"48","v6.4.0":"48","v6.5.0":"48","v6.6.0":"48","v6.7.0":"48","v6.8.0":"48","v6.8.1":"48","v6.9.0":"48","v6.9.1":"48","v6.9.2":"48","v6.9.3":"48","v6.9.4":"48","v6.9.5":"48","v7.0.0":"51","v7.1.0":"51","v7.10.0":"51","v7.10.1":"51","v7.2.0":"51","v7.2.1":"51","v7.3.0":"51","v7.4.0":"51","v7.5.0":"51","v7.6.0":"51","v7.7.1":"51","v7.7.2":"51","v7.7.3":"51","v7.7.4":"51","v7.8.0":"51","v7.9.0":"51","v8.0.0":"57","v8.1.0":"57","v8.1.1":"57","v8.1.2":"57","v8.1.3":"57","v8.1.4":"57","v8.2.0":"57","v8.2.1":"57","v8.3.0":"57","v8.4.0":"57","v8.5.0":"57","v8.6.0":"57","v8.7.0":"57","v8.8.0":"57","v8.8.1":"57","v8.9.0":"57","v8.9.1":"57","v8.9.2":"57","v8.9.3":"57","v8.9.4":"57","v8.10.0":"57","v8.11.0":"57","v8.11.1":"57","v9.0.0":"59","v9.1.0":"59","v9.2.0":"59","v9.2.1":"59","v9.3.0":"59","v9.4.0":"59","v9.5.0":"59","v9.6.0":"59","v9.6.1":"59","v9.7.0":"59","v9.7.1":"59","v9.8.0":"59","v9.9.0":"59","v9.10.0":"59","v9.10.1":"59","v9.11.0":"59","v9.11.1":"59"}
27.8 KB
Binary file not shown.
27.8 KB
Binary file not shown.
37.4 KB
Binary file not shown.
37.4 KB
Binary file not shown.
37.5 KB
Binary file not shown.
37.5 KB
Binary file not shown.
34.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)