@@ -1442,32 +1442,39 @@ func TestRecordRequestTPOT(t *testing.T) {
14421442 received := timeBaseline
14431443 firstToken := timeBaseline .Add (500 * time .Millisecond )
14441444 complete := timeBaseline .Add (2000 * time .Millisecond )
1445- require .True (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , received , firstToken , complete , 11 ))
1445+ require .True (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , true , received , firstToken , complete , 11 ))
14461446
14471447 h , err := getHistogramVecLabelValues (t , llmdRequestTPOT , "m10" , "t10" , "tenant-a" , "3" )
14481448 require .NoError (t , err )
14491449 require .Equal (t , uint64 (1 ), h .GetSampleCount ())
14501450 require .InDelta (t , 0.15 , h .GetSampleSum (), 0.001 )
14511451 })
14521452
1453+ t .Run ("non-streaming skipped without error log" , func (t * testing.T ) {
1454+ received := timeBaseline
1455+ firstToken := timeBaseline .Add (500 * time .Millisecond )
1456+ // Non-streaming: the whole body arrives at once, so complete == firstToken.
1457+ require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , false , received , firstToken , firstToken , 11 ))
1458+ })
1459+
14531460 t .Run ("single token skipped" , func (t * testing.T ) {
1454- require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , timeBaseline , timeBaseline .Add (100 * time .Millisecond ), timeBaseline .Add (200 * time .Millisecond ), 1 ))
1461+ require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , true , timeBaseline , timeBaseline .Add (100 * time .Millisecond ), timeBaseline .Add (200 * time .Millisecond ), 1 ))
14551462 })
14561463
14571464 t .Run ("zero tokens skipped" , func (t * testing.T ) {
1458- require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , timeBaseline , timeBaseline .Add (100 * time .Millisecond ), timeBaseline .Add (200 * time .Millisecond ), 0 ))
1465+ require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , true , timeBaseline , timeBaseline .Add (100 * time .Millisecond ), timeBaseline .Add (200 * time .Millisecond ), 0 ))
14591466 })
14601467
14611468 t .Run ("zero first token timestamp" , func (t * testing.T ) {
1462- require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , timeBaseline , time.Time {}, timeBaseline .Add (200 * time .Millisecond ), 10 ))
1469+ require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , true , timeBaseline , time.Time {}, timeBaseline .Add (200 * time .Millisecond ), 10 ))
14631470 })
14641471
14651472 t .Run ("first token before received" , func (t * testing.T ) {
1466- require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , timeBaseline .Add (100 * time .Millisecond ), timeBaseline , timeBaseline .Add (200 * time .Millisecond ), 10 ))
1473+ require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , true , timeBaseline .Add (100 * time .Millisecond ), timeBaseline , timeBaseline .Add (200 * time .Millisecond ), 10 ))
14671474 })
14681475
14691476 t .Run ("complete before first token" , func (t * testing.T ) {
1470- require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , timeBaseline , timeBaseline .Add (200 * time .Millisecond ), timeBaseline .Add (100 * time .Millisecond ), 10 ))
1477+ require .False (t , RecordRequestTPOT (ctx , "m10" , "t10" , "tenant-a" , "3" , true , timeBaseline , timeBaseline .Add (200 * time .Millisecond ), timeBaseline .Add (100 * time .Millisecond ), 10 ))
14711478 })
14721479}
14731480
0 commit comments