Skip to content

Commit 6648751

Browse files
committed
Adds the client bench command.
1 parent ce3498e commit 6648751

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

client/client.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,13 @@ client.reduxMiddleware = (store) => (next) => (action) => {
271271
return result
272272
}
273273

274-
client.measure = (title) => {
275-
const times = []
276-
const step = () => times.push(performanceNow())
277-
step()
278-
const stop = () => {
279-
step()
280-
client.log({title, times})
274+
client.bench = (title) => {
275+
const steps = []
276+
const step = (stepTitle) => steps.push({title: stepTitle, time: performanceNow()})
277+
step(title)
278+
const stop = (stopTitle) => {
279+
step(stopTitle)
280+
client.sendCommand('bench.report', {title, steps})
281281
}
282282
return {step, stop}
283283
}

0 commit comments

Comments
 (0)