Skip to content

Commit

Permalink
Fix variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Aug 25, 2019
1 parent f867b5c commit b194218
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { report } from './report/main.js'
import { addToStore } from './store/add.js'
import { getFromStore } from './store/get.js'
import { removeFromStore } from './store/remove.js'
import { migrateStore } from './store/migrate.js'
import { migrateStore } from './store/migrate/main.js'
import { destroyStore } from './store/destroy.js'
import { runBenchmark } from './run.js'
import { debugBenchmark } from './debug.js'
Expand All @@ -13,9 +13,9 @@ import { debugBenchmark } from './debug.js'
export const run = async function(opts) {
const optsA = await getOpts('run', opts)

const benchmark = await runBenchmark(optsA)
const rawBenchmark = await runBenchmark(optsA)

const { group, benchmarks } = await addToStore(benchmark, optsA)
const { group, benchmarks } = await addToStore(rawBenchmark, optsA)

const benchmarkA = await report(group, benchmarks, optsA)

Expand Down
14 changes: 7 additions & 7 deletions src/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export const runBenchmark = async function(opts) {
const { progressState, progressInfo } = await startProgress(iterations, opts)

// TODO: replace with `try {} finally {}` when dropping support for Node 8/9
const benchmark = await pFinally(
const rawBenchmark = await pFinally(
computeBenchmark({ iterations, progressState, opts, versions }),
() => stopProgress(progressInfo),
)
return benchmark
return rawBenchmark
}

const computeBenchmark = async function({
Expand All @@ -33,8 +33,8 @@ const computeBenchmark = async function({
const iterationsA = await pMapSeries(iterations, (iteration, index) =>
runProcesses({ ...iteration, index, progressState, opts }),
)
const benchmark = addBenchmarkInfo(iterationsA, { opts, versions })
return benchmark
const rawBenchmark = addBenchmarkInfo(iterationsA, { opts, versions })
return rawBenchmark
}

// Add more information to the final benchmark and normalize/sort results
Expand All @@ -47,7 +47,7 @@ const addBenchmarkInfo = function(
const timestamp = new Date().toISOString()
const { git, ci, job } = getCiInfo(cwd)
const systems = getSystems({ opts, system, job })
const benchmark = {
const rawBenchmark = {
version,
id,
timestamp,
Expand All @@ -57,6 +57,6 @@ const addBenchmarkInfo = function(
ci,
iterations,
}
const benchmarkA = cleanObject(benchmark)
return benchmarkA
const rawBenchmarkA = cleanObject(rawBenchmark)
return rawBenchmarkA
}
2 changes: 1 addition & 1 deletion src/store/remove.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Call `store.remove()`
export const removeFromStore = async function(group, rawBenchmarks, { store }) {
const ids = rawBenchmarks
.filter(benchmark => benchmark.group === group)
.filter(rawBenchmark => rawBenchmark.group === group)
.map(getId)

try {
Expand Down

0 comments on commit b194218

Please sign in to comment.