Skip to content

Commit b6570e2

Browse files
committed
scenarios with more spans
1 parent b6a7208 commit b6570e2

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

packages/core/test/bench/startSpan.bench.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,34 @@ describe('startSpan pipeline - realistic scope', () => {
7272
}
7373
});
7474
});
75+
76+
bench('root span + 100 child spans', () => {
77+
startSpan({ name: 'GET /api/users', op: 'http.server' }, () => {
78+
for (let i = 0; i < 100; i++) {
79+
startSpan({ name: `operation.${i}`, op: 'db' }, span => {
80+
span.setAttribute('db.system', 'postgresql');
81+
});
82+
}
83+
});
84+
});
85+
86+
bench('root span + 1000 child spans', () => {
87+
startSpan({ name: 'GET /api/users', op: 'http.server' }, () => {
88+
for (let i = 0; i < 1000; i++) {
89+
startSpan({ name: `operation.${i}`, op: 'db' }, span => {
90+
span.setAttribute('db.system', 'postgresql');
91+
});
92+
}
93+
});
94+
});
95+
96+
bench('root span + 10000 child spans', () => {
97+
startSpan({ name: 'GET /api/users', op: 'http.server' }, () => {
98+
for (let i = 0; i < 10000; i++) {
99+
startSpan({ name: `operation.${i}`, op: 'db' }, span => {
100+
span.setAttribute('db.system', 'postgresql');
101+
});
102+
}
103+
});
104+
});
75105
});

0 commit comments

Comments
 (0)