pm2-perfmonitor 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/perf-sampler.js +9 -3
- package/package.json +1 -1
package/lib/perf-sampler.js
CHANGED
|
@@ -186,7 +186,9 @@ const performPerfSampling = async ({
|
|
|
186
186
|
|
|
187
187
|
// --- Step 2: perf script 导出为文本堆栈 ---
|
|
188
188
|
const scriptOk = await execCommand('perf', ['script', '-i', perfDataFile], {
|
|
189
|
-
stdout:
|
|
189
|
+
stdout: {
|
|
190
|
+
file: perfStacksFile,
|
|
191
|
+
},
|
|
190
192
|
})
|
|
191
193
|
|
|
192
194
|
if (!scriptOk) return
|
|
@@ -217,14 +219,18 @@ const performPerfSampling = async ({
|
|
|
217
219
|
stackcollapsePath,
|
|
218
220
|
[perfStacksFile],
|
|
219
221
|
{
|
|
220
|
-
stdout:
|
|
222
|
+
stdout: {
|
|
223
|
+
file: perfFoldedFile,
|
|
224
|
+
},
|
|
221
225
|
},
|
|
222
226
|
)
|
|
223
227
|
if (!collapseOk) return
|
|
224
228
|
|
|
225
229
|
// --- Step 5: 生成 SVG 火焰图 ---
|
|
226
230
|
const flameOk = await execCommand(flamegraphPath, [perfFoldedFile], {
|
|
227
|
-
stdout:
|
|
231
|
+
stdout: {
|
|
232
|
+
file: perfSvgFile,
|
|
233
|
+
},
|
|
228
234
|
})
|
|
229
235
|
if (flameOk) {
|
|
230
236
|
logger('info', `PID:${pidNum} Flame graph generated: ${perfSvgFile}`)
|