From f06146bb5a2b6dd3139a9dbf4cd1d28ddfe32245 Mon Sep 17 00:00:00 2001 From: Oliver Wheeler Date: Fri, 16 Oct 2020 18:57:16 +0200 Subject: [PATCH 1/2] feat: Add option to set output filename --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index b3237d1..2d92bbb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -25,6 +25,7 @@ export interface ProfilerOptions { concurrency: number; prefix: string; outDir: string; + outFileName?: string; } export default class Profiler { @@ -33,12 +34,12 @@ export default class Profiler { private threads: number[]; constructor(opts: ProfilerOptions) { - const { concurrency, outDir, prefix } = opts; + const { concurrency, outDir, prefix, outFileName } = opts; this.events = []; this.outputPath = path.join( path.resolve(outDir || "."), - getTimeBasedFilename(prefix) + outFileName ?? getTimeBasedFilename(prefix) ); this.threads = range(concurrency); } From c812b5cbfe4d0794c5b8314163be0589f13a5659 Mon Sep 17 00:00:00 2001 From: Oliver Wheeler Date: Fri, 16 Oct 2020 19:00:08 +0200 Subject: [PATCH 2/2] Change files --- .../p-profiler-2020-10-16-19-00-08-optional-out-file.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 change/p-profiler-2020-10-16-19-00-08-optional-out-file.json diff --git a/change/p-profiler-2020-10-16-19-00-08-optional-out-file.json b/change/p-profiler-2020-10-16-19-00-08-optional-out-file.json new file mode 100644 index 0000000..84c3462 --- /dev/null +++ b/change/p-profiler-2020-10-16-19-00-08-optional-out-file.json @@ -0,0 +1,8 @@ +{ + "type": "minor", + "comment": "feat: Add option to set output filename", + "packageName": "p-profiler", + "email": "olwheele@microsoft.com", + "dependentChangeType": "patch", + "date": "2020-10-16T17:00:08.686Z" +}