Skip to content

Commit 28c334f

Browse files
authored
feat(NODE-6757): support tags for perf.send (#29)
1 parent a29cb0e commit 28c334f

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

packages/bson-bench/src/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export type BenchmarkSpecification = {
134134
* local package */
135135
library: string;
136136
installLocation?: string;
137+
tags?: string[];
137138
};
138139

139140
export interface RunBenchmarkMessage {

packages/bson-bench/src/task.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export class Task {
119119
const perfSendResults: PerfSendResult = {
120120
info: {
121121
test_name: this.testName,
122+
tags: this.benchmark.tags,
122123
args: {
123124
warmup: this.benchmark.warmup,
124125
iterations: this.benchmark.iterations,

packages/bson-bench/test/unit/suite.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ describe('Suite', function () {
8888
warmup: 10,
8989
iterations: 10,
9090
library: '[email protected]',
91-
options: {}
91+
options: {},
92+
tags: ['test']
9293
};
9394
suite
9495
.task({

packages/bson-bench/test/unit/task.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ describe('Task', function () {
4242
operation,
4343
warmup: 100,
4444
iterations: 100,
45-
options: {}
45+
options: {},
46+
tags: ['test']
4647
}
4748
];
4849
})
@@ -210,7 +211,8 @@ describe('Task', function () {
210211
operation: 'deserialize',
211212
warmup: 1,
212213
iterations: 1,
213-
options
214+
options,
215+
tags: ['test', 'test2']
214216
});
215217

216218
task.result = {
@@ -226,6 +228,10 @@ describe('Task', function () {
226228
expect(results.info).to.haveOwnProperty('args');
227229
});
228230

231+
it('returns the tags in the info.tags field', function () {
232+
expect(results.info.tags).to.deep.equal(['test', 'test2']);
233+
});
234+
229235
it('returns options provided in constructor in the info.args field', function () {
230236
expect(results.info.args).to.haveOwnProperty('warmup');
231237
expect(results.info.args).to.haveOwnProperty('iterations');

0 commit comments

Comments
 (0)