@@ -111,7 +111,7 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
111
111
BytesInFlight -= size;
112
112
--RequestsInFlight;
113
113
}
114
-
114
+
115
115
TString ToString () const {
116
116
return TStringBuilder () << " {"
117
117
<< " Requests# " << RequestsInFlight << " /" << MaxRequestsInFlight
@@ -311,7 +311,7 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
311
311
Now = now;
312
312
while (now >= CurrentEpochEnd) {
313
313
CurrentEpochEnd += EpochDuration;
314
- RequestsPerEpoch = CalculateRequestRate (now);
314
+ RequestsPerEpoch = CalculateRequestRate (now);
315
315
PlannedForCurrentEpoch += RequestsPerEpoch;
316
316
}
317
317
@@ -401,11 +401,13 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
401
401
TDeque<std::pair<ui64, ui64>> WritesInFlightTimestamps;
402
402
TSpeedTracker<ui64> MegabytesPerSecondST;
403
403
TQuantileTracker<ui64> MegabytesPerSecondQT;
404
+ TSpeedTracker<ui64> PutsPerSecondST;
405
+ TQuantileTracker<ui64> PutsPerSecondQT;
404
406
std::unique_ptr<TLatencyTrackerUs> ResponseQT;
405
407
TQuantileTracker<ui32> WritesInFlightQT;
406
408
TQuantileTracker<ui64> WriteBytesInFlightQT;
407
409
TDeque<TMonotonic> IssuedWriteTimestamp;
408
-
410
+
409
411
// Reads
410
412
const NKikimrBlobStorage::EGetHandleClass GetHandleClass;
411
413
TRequestDispatchingSettings ReadSettings;
@@ -420,7 +422,10 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
420
422
TQuantileTracker<ui32> ReadsInFlightQT;
421
423
TQuantileTracker<ui64> ReadBytesInFlightQT;
422
424
423
- TIntrusivePtr<NMonitoring::TCounterForPtr> MaxInFlightLatency;
425
+ ::NMonitoring::TDynamicCounters::TCounterPtr MaxInFlightLatency;
426
+ ::NMonitoring::TDynamicCounters::TCounterPtr OkPutResultsCounter;
427
+ ::NMonitoring::TDynamicCounters::TCounterPtr BadPutResultsCounter;
428
+
424
429
bool IsWorkingNow = true ;
425
430
426
431
TMonotonic LastLatencyTrackerUpdate;
@@ -476,6 +481,9 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
476
481
, MegabytesPerSecondST(TDuration::Seconds(3 )) // average speed at last 3 seconds
477
482
, MegabytesPerSecondQT(ExposePeriod, Counters->GetSubgroup (" metric" , " writeSpeed" ),
478
483
"bytesPerSecond", Percentiles)
484
+ , PutsPerSecondST(TDuration::Seconds(3 )) // average speed at last 3 seconds
485
+ , PutsPerSecondQT(ExposePeriod, Counters->GetSubgroup (" metric" , " writeSpeed" ),
486
+ "putsPerSecond", Percentiles)
479
487
, ResponseQT(new TLatencyTrackerUs())
480
488
, WritesInFlightQT(ExposePeriod, Counters->GetSubgroup (" metric" , " writesInFlight" ),
481
489
"items", Percentiles)
@@ -500,10 +508,12 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
500
508
, TracingThrottler(tracingThrottler)
501
509
{
502
510
*Counters->GetCounter (" tabletId" ) = tabletId;
503
- const auto & percCounters = Counters->GetSubgroup (" subsystem" , " latency" );
504
- MaxInFlightLatency = percCounters->GetCounter (" MaxInFlightLatencyUs" );
505
- ResponseQT->Initialize (percCounters->GetSubgroup (" sensor" , " writeResponseUs" ), Percentiles);
506
- ReadResponseQT->Initialize (percCounters->GetSubgroup (" sensor" , " readResponseUs" ), Percentiles);
511
+ const auto & percCounters = Counters->GetSubgroup (" sensor" , " microseconds" );
512
+ MaxInFlightLatency = percCounters->GetCounter (" MaxInFlightLatency" );
513
+ OkPutResultsCounter = percCounters->GetCounter (" OkPutResults" , true );
514
+ BadPutResultsCounter = percCounters->GetCounter (" BadPutResults" , true );
515
+ ResponseQT->Initialize (percCounters->GetSubgroup (" metric" , " writeResponse" ), Percentiles);
516
+ ReadResponseQT->Initialize (percCounters->GetSubgroup (" metric" , " readResponse" ), Percentiles);
507
517
}
508
518
509
519
TString PrintMe () {
@@ -662,7 +672,7 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
662
672
auto callback = [this ](IEventBase *event, const TActorContext& ctx) {
663
673
auto *res = dynamic_cast <TEvBlobStorage::TEvCollectGarbageResult*>(event);
664
674
Y_ABORT_UNLESS (res);
665
-
675
+
666
676
if (!MainCycleStarted) {
667
677
Self.InitialAllocationCompleted (ctx);
668
678
}
@@ -701,6 +711,9 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
701
711
MegabytesPerSecondST.Add (now, 0 );
702
712
MegabytesPerSecondQT.Add (now, 0 );
703
713
714
+ PutsPerSecondST.Add (now, 0 );
715
+ PutsPerSecondQT.Add (now, 0 );
716
+
704
717
ReadMegabytesPerSecondST.Add (now, 0 );
705
718
ReadMegabytesPerSecondQT.Add (now, 0 );
706
719
@@ -716,6 +729,10 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
716
729
if (MegabytesPerSecondST.CalculateSpeed (&speed)) {
717
730
MegabytesPerSecondQT.Add (now, speed);
718
731
}
732
+ PutsPerSecondST.Add (now, OkPutResults);
733
+ if (PutsPerSecondST.CalculateSpeed (&speed)) {
734
+ PutsPerSecondQT.Add (now, speed);
735
+ }
719
736
ReadMegabytesPerSecondST.Add (now, TotalBytesRead);
720
737
if (ReadMegabytesPerSecondST.CalculateSpeed (&speed)) {
721
738
ReadMegabytesPerSecondQT.Add (now, speed);
@@ -741,6 +758,7 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
741
758
742
759
void ExposeCounters (const TActorContext &ctx) {
743
760
MegabytesPerSecondQT.CalculateQuantiles ();
761
+ PutsPerSecondQT.CalculateQuantiles ();
744
762
ReadMegabytesPerSecondQT.CalculateQuantiles ();
745
763
746
764
WritesInFlightQT.CalculateQuantiles ();
@@ -798,8 +816,9 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
798
816
799
817
static constexpr size_t count = 5 ;
800
818
std::array<size_t , count> nums{{9000 , 9900 , 9990 , 9999 , 10000 }};
801
- std::array<ui64, count> qSpeed;
819
+ std::array<ui64, count> qSpeed, qPPS ;
802
820
MegabytesPerSecondQT.CalculateQuantiles (count, nums.data (), 10000 , qSpeed.data ());
821
+ PutsPerSecondQT.CalculateQuantiles (count, nums.data (), 10000 , qPPS.data ());
803
822
804
823
TABLER () {
805
824
TABLED () { str << " Writes per second" ; }
@@ -818,6 +837,12 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
818
837
ui64 x = qSpeed[i] * 100 / 1048576 ;
819
838
TABLED () { str << Sprintf (" %" PRIu64 " .%02d MB/s" , x / 100 , int (x % 100 )); }
820
839
}
840
+
841
+ TABLER () {
842
+ TABLED () { str << Sprintf (" WriteSpeed@ %d.%02d%%" , int (nums[i] / 100 ), int (nums[i] % 100 )); }
843
+ ui64 x = qPPS[i] * 100 ;
844
+ TABLED () { str << Sprintf (" %" PRIu64 " .%02d Puts/s" , x / 100 , int (x % 100 )); }
845
+ }
821
846
}
822
847
823
848
ReadMegabytesPerSecondQT.CalculateQuantiles (count, nums.data (), 10000 , qSpeed.data ());
@@ -894,6 +919,7 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
894
919
WriteSettings.DelayManager ->CountResponse ();
895
920
const bool ok = CheckStatus (ctx, res, {NKikimrProto::EReplyStatus::OK});
896
921
++ (ok ? OkPutResults : BadPutResults);
922
+ ++ *(ok ? OkPutResultsCounter : BadPutResultsCounter);
897
923
898
924
const TLogoBlobID& id = res->Id ;
899
925
const ui32 size = id.BlobSize ();
@@ -1045,7 +1071,7 @@ class TLogWriterLoadTestActor : public TActorBootstrapped<TLogWriterLoadTestActo
1045
1071
ui32 initialBlobs = InitialAllocation.ConfirmedSize ();
1046
1072
Y_ABORT_UNLESS (confirmedBlobs + initialBlobs > 0 );
1047
1073
ui32 blobIdx = RandomNumber (confirmedBlobs + initialBlobs);
1048
-
1074
+
1049
1075
if (blobIdx < confirmedBlobs) {
1050
1076
auto iter = ConfirmedBlobIds.begin ();
1051
1077
std::advance (iter, blobIdx);
0 commit comments