This commit is contained in:
Ken Chau 2020-10-19 13:47:09 -07:00
Родитель f60d98363e
Коммит f693c73979
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -25,6 +25,7 @@ export interface ProfilerOptions {
concurrency: number;
prefix: string;
outDir: string;
customOutputPath: string;
}
export default class Profiler {
@ -33,13 +34,12 @@ export default class Profiler {
private threads: number[];
constructor(opts: ProfilerOptions) {
const { concurrency, outDir, prefix } = opts;
const { concurrency, outDir, prefix, customOutputPath } = opts;
this.events = [];
this.outputPath = path.join(
path.resolve(outDir || "."),
getTimeBasedFilename(prefix)
);
this.outputPath =
customOutputPath ||
path.join(path.resolve(outDir || "."), getTimeBasedFilename(prefix));
this.threads = range(concurrency);
}