Skip to content

Commit

Permalink
expand metrics assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Feb 7, 2025
1 parent 9044eef commit 7017def
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/versioned/otel-bridge/span.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,18 @@ test('http metrics are bridged correctly', (t, end) => {
assert.equal(attrs.nr_exclusive_duration_millis, duration)

const unscopedMetrics = tx.metrics.unscoped
assert.equal(unscopedMetrics.WebTransaction.callCount, 1)
assert.equal(unscopedMetrics[segment.name].callCount, 1)
const expectedMetrics = [
'HttpDispatcher',
'WebTransaction',
'WebTransactionTotalTime',
'WebTransactionTotalTime/null',
segment.name
]
for (const expectedMetric of expectedMetrics) {
assert.equal(unscopedMetrics[expectedMetric].callCount, 1, `${expectedMetric} has correct callCount`)
}
assert.equal(unscopedMetrics.Apdex.apdexT, 0.1)
assert.equal(unscopedMetrics['Apdex/null'].apdexT, 0.1)

end()
})
Expand Down

0 comments on commit 7017def

Please sign in to comment.