Mojito-waterfallnpm 開發(fā)包
Mojito-waterfall 是用于生成性能可視化的 Mojito 應(yīng)用程序 npm 開發(fā)包。它包括一個用來收集計時數(shù)據(jù)的 API 和一個呈現(xiàn)瀑布流(waterfall)的 mojit。mojito-debug 開發(fā)包使用這個開發(fā)包呈現(xiàn)瀑布流可視化。
代碼示例:
{
headers: ['Name', 'Type`],
units: 'ms',
rows: [{
Name: 'Main',
Type: 'Mojit',
durations: [{
startTime: 0,
duration: 100,
name: 'Elapsed Time',
color: 'green'
}],
details: [{
Name: 'Controller',
durations: [{
startTime: 10,
duration: 30,
name: 'Elapsed Time',
color: '#1133CC'
}]
}]
}],
events: [{
name: 'Render Start',
time: 85,
color: 'rgb(220, 30, 40)'
}],
stats: [{
"Name": "dispatch",
"Calls": 36,
"Total Duration": "45.97ms",
"Avg Duration": "1.277ms",
"Min Duration": "255.7μs (Child)",
"Max Duration": "23.57ms (Main)",
"summary": [{
"Name": "Main",
"Duration": "23.57ms"
}]
}]
}
評論
圖片
表情
