Skip to content

Commit

Permalink
Rename segments to segmentCount.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstange committed Dec 2, 2016
1 parent 45c1635 commit 2bb1374
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/summarize-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export function summarizeCategories (profile, threadCategories) {
// .sort((a, b) => Object.keys(b.summary).length - Object.keys(a.summary).length);
}

export function calculateRollingSummaries (profile, threadCategories, segments = 40, rolling = 4) {
export function calculateRollingSummaries (profile, threadCategories, segmentCount = 40, rolling = 4) {
const [minTime, maxTime] = profile.threads.map(thread => {
return [thread.samples.time[0], thread.samples.time[thread.samples.time.length - 1]];
})
Expand All @@ -236,15 +236,15 @@ export function calculateRollingSummaries (profile, threadCategories, segments =
Math.max(a[1], b[1]),
]));
const totalTime = maxTime - minTime;
const segmentLength = totalTime / segments;
const segmentLength = totalTime / segmentCount;
const segmentHalfLength = segmentLength / 2;
const rollingLength = segmentLength * rolling;
const rollingHalfLength = segmentLength * rolling / 2;

return profile.threads.map((thread, threadIndex) => {
const categories = threadCategories[threadIndex];

return times(segments, (segmentIndex) => {
return times(segmentCount, (segmentIndex) => {
let samplesInRange = 0;
const samples = {};

Expand Down

0 comments on commit 2bb1374

Please sign in to comment.