@@ -78,8 +78,8 @@ describe('The Trace agent', function () {
7878 expect ( agent . totalRequestCount ) . to . eql ( 1 )
7979 expect ( agent . partials [ transactionId ] ) . to . eql ( {
8080 requestId : transactionId ,
81- isSampled : false ,
8281 isForceSampled : false ,
82+ isSampled : false ,
8383 events : [ {
8484 type : 'sr' ,
8585 time : time ,
@@ -112,8 +112,8 @@ describe('The Trace agent', function () {
112112 expect ( agent . totalRequestCount ) . to . eql ( 1 )
113113 expect ( agent . partials [ transactionId ] ) . to . eql ( {
114114 requestId : transactionId ,
115- isSampled : false ,
116115 isForceSampled : false ,
116+ isSampled : false ,
117117 events : [ {
118118 type : 'sr' ,
119119 time : time ,
@@ -130,7 +130,6 @@ describe('The Trace agent', function () {
130130
131131 it ( 'does server send' , function ( ) {
132132 var statusCode = 200
133- agent . sampleRate = 1
134133 agent . serverReceive ( {
135134 id : transactionId ,
136135 spanId : spanId ,
@@ -144,7 +143,8 @@ describe('The Trace agent', function () {
144143 id : transactionId ,
145144 spanId : spanId ,
146145 responseTime : responseTime ,
147- statusCode : statusCode
146+ statusCode : statusCode ,
147+ mustCollect : '1'
148148 } )
149149
150150 expect ( rpmMetrics . addResponseTime ) . to . have . been . calledWith ( responseTime )
@@ -153,8 +153,8 @@ describe('The Trace agent', function () {
153153 expect ( agent . partials ) . to . eql ( { } )
154154 expect ( agent . spans ) . to . eql ( [ {
155155 requestId : transactionId ,
156- isSampled : true ,
157- isForceSampled : false ,
156+ isForceSampled : true ,
157+ isSampled : false ,
158158 events : [ {
159159 type : 'sr' ,
160160 time : time ,
@@ -198,8 +198,8 @@ describe('The Trace agent', function () {
198198 expect ( agent . spans ) . to . eql ( [ ] )
199199 expect ( agent . partials [ transactionId ] ) . to . eql ( {
200200 requestId : transactionId ,
201- isSampled : false ,
202201 isForceSampled : false ,
202+ isSampled : false ,
203203 events : [ {
204204 type : 'sr' ,
205205 time : time ,
@@ -240,8 +240,8 @@ describe('The Trace agent', function () {
240240 expect ( agent . spans ) . to . eql ( [ ] )
241241 expect ( agent . partials [ transactionId ] ) . to . eql ( {
242242 requestId : transactionId ,
243- isSampled : false ,
244243 isForceSampled : false ,
244+ isSampled : false ,
245245 events : [ {
246246 type : 'sr' ,
247247 time : time ,
@@ -284,8 +284,8 @@ describe('The Trace agent', function () {
284284 expect ( agent . spans ) . to . eql ( [ ] )
285285 expect ( agent . partials [ transactionId ] ) . to . eql ( {
286286 requestId : transactionId ,
287- isSampled : false ,
288287 isForceSampled : false ,
288+ isSampled : false ,
289289 events : [ {
290290 type : 'sr' ,
291291 time : time ,
@@ -316,19 +316,16 @@ describe('The Trace agent', function () {
316316 2 ,
317317 3
318318 ]
319- agent . sampleRate = 2
320319 agent . totalRequestCount = 6
321- agent . sampleSize = 10
322320 agent . _send ( )
323321
324- expect ( agent . sampleRate ) . to . eql ( 1 )
325322 expect ( agent . totalRequestCount ) . to . eql ( 0 )
326323 expect ( collectorApi . sendSamples ) . to . be . calledWith ( {
324+ spans : [ 1 , 2 , 3 ] ,
327325 sample : {
328- rate : 2 ,
329- totalRequestCount : 6
330- } ,
331- spans : [ 1 , 2 , 3 ]
326+ rate : 1 ,
327+ totalRequestCount : 1
328+ }
332329 } )
333330 } )
334331
0 commit comments