性能数据收集
const {contentTracing} = require('electron')
const options = {
categoryFilter: '*',
traceOptions: 'record-until-full,enable-sampling'
}
contentTracing.startRecording(options, () => {
console.log('Tracing started')
setTimeout(() => {
contentTracing.stopRecording('', (path) => {
console.log('Tracing data recorded to ' + path)
})
}, 5000)
})方法
contentTracing.getCategories(callback)
contentTracing.getCategories(callback)contentTracing.startRecording(options, callback)
contentTracing.startRecording(options, callback)contentTracing.stopRecording(resultFilePath, callback)
contentTracing.stopRecording(resultFilePath, callback)contentTracing.startMonitoring(options, callback)
contentTracing.startMonitoring(options, callback)contentTracing.stopMonitoring(callback)
contentTracing.stopMonitoring(callback)contentTracing.captureMonitoringSnapshot(resultFilePath, callback)
contentTracing.captureMonitoringSnapshot(resultFilePath, callback)contentTracing.getTraceBufferUsage(callback)
contentTracing.getTraceBufferUsage(callback)Last updated