Skip to content

Commit

Permalink
Fix prettier errors
Browse files Browse the repository at this point in the history
  • Loading branch information
simonepri committed May 28, 2018
1 parent d0545b9 commit b4f2683
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const cli = meow(
flags: {
raw: {type: 'boolean', default: false},
interval: {type: 'number', default: 125},
cwd: {type: 'string', default: process.cwd()},
},
cwd: {type: 'string', default: process.cwd()}
}
}
);

Expand All @@ -46,7 +46,7 @@ Promise.resolve()
}
return impact(cli.input[0], {
interval: cli.flags.interval,
cwd: cli.flags.cwd,
cwd: cli.flags.cwd
});
})
.then(async report => {
Expand Down
20 changes: 10 additions & 10 deletions lib/profiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function getAverages(values) {
median: stats.median(values),
stdev: stats.stdev(values),
max: Math.max(...values),
min: Math.min(...values),
min: Math.min(...values)
};
}

Expand Down Expand Up @@ -61,43 +61,43 @@ function Profiler(ppid, period) {
samples[frame] = {
cpu: snapshots[frame].reduce((acc, cur) => acc + cur.cpu, 0),
memory: snapshots[frame].reduce((acc, cur) => acc + cur.memory, 0),
processes: snapshots[frame],
processes: snapshots[frame]
};
});

const usage = {
cpu: getAverages(frames.map(frame => samples[frame].cpu)),
memory: getAverages(frames.map(frame => samples[frame].memory)),
memory: getAverages(frames.map(frame => samples[frame].memory))
};

const report = {
times: {
sampling: {
start,
end,
end
},
execution: {
start: from || start,
end: to || end,
},
end: to || end
}
},
stats: {
cpu: usage.cpu,
memory: usage.memory,
memory: usage.memory
},
samples: {
period,
count: frames.length,
list: samples,
},
list: samples
}
};
return report;
}

return {
watch,
unwatch,
report,
report
};
}

Expand Down
10 changes: 5 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const schema = {
end: joi
.number()
.integer()
.min(0),
.min(0)
}),
avarage: joi.object().keys({
mean: joi.number().min(0),
median: joi.number().min(0),
stdev: joi.number().min(0),
max: joi.number().min(0),
min: joi.number().min(0),
min: joi.number().min(0)
}),
sample: joi.object().keys({
cpu: joi.number().min(0),
Expand Down Expand Up @@ -58,10 +58,10 @@ const schema = {
timestamp: joi
.number()
.integer()
.min(0),
.min(0)
})
),
}),
)
})
};

test('should monitor pid without childs correctly', async t => {
Expand Down

0 comments on commit b4f2683

Please sign in to comment.