@@ -106,19 +106,10 @@ void TestDSProxyAndVDiskEqualCost(const TBlobStorageGroupInfo::TTopology& topolo
106
106
if (dsproxyCost == vdiskCost) {
107
107
return ;
108
108
}
109
+ UNIT_ASSERT (queuePut != 0 );
109
110
UNIT_ASSERT_C (oks != actor->RequestsSent || queuePut != queueSent, str.Str ());
110
111
}
111
112
112
- #define MAKE_TEST (erasure, requestType, requests, inflight ) \
113
- Y_UNIT_TEST (Test##requestType##erasure##Requests##requests##Inflight##inflight) { \
114
- auto groupType = TBlobStorageGroupType::Erasure##erasure; \
115
- ui32 realms = (groupType == TBlobStorageGroupType::ErasureMirror3dc) ? 3 : 1 ; \
116
- ui32 domains = (groupType == TBlobStorageGroupType::ErasureMirror3dc) ? 3 : 8 ; \
117
- TBlobStorageGroupInfo::TTopology topology (groupType, realms, domains, 1 , true ); \
118
- auto actor = new TInflightActor##requestType ({requests, inflight}); \
119
- TestDSProxyAndVDiskEqualCost (topology, actor); \
120
- }
121
-
122
113
#define MAKE_TEST_W_DATASIZE (erasure, requestType, requests, inflight, dataSize ) \
123
114
Y_UNIT_TEST (Test##requestType##erasure##Requests##requests##Inflight##inflight##BlobSize##dataSize) { \
124
115
auto groupType = TBlobStorageGroupType::Erasure##erasure; \
@@ -283,4 +274,54 @@ Y_UNIT_TEST_SUITE(DiskTimeAvailable) {
283
274
}
284
275
}
285
276
277
+ template <typename TInflightActor>
278
+ void TestDSProxyAndVDiskEqualByteCounters (TInflightActor* actor) {
279
+ std::unique_ptr<TEnvironmentSetup> env;
280
+ ui32 groupSize;
281
+ TBlobStorageGroupType groupType;
282
+ ui32 groupId;
283
+ std::vector<ui32> pdiskLayout;
284
+ TBlobStorageGroupInfo::TTopology topology (TBlobStorageGroupType::ErasureMirror3dc, 3 , 3 , 1 , true );
285
+ SetupEnv (topology, env, groupSize, groupType, groupId, pdiskLayout);
286
+ actor->SetGroupId (TGroupId::FromValue (groupId));
287
+ env->Runtime ->Register (actor, 1 );
288
+ env->Sim (TDuration::Minutes (10 ));
289
+ ui64 dsproxyCounter = 0 ;
290
+ ui64 vdiskCounter = 0 ;
291
+
292
+ for (ui32 nodeId = 1 ; nodeId <= groupSize; ++nodeId) {
293
+ auto * appData = env->Runtime ->GetNode (nodeId)->AppData .get ();
294
+ for (auto sizeClass : {" 256" , " 4096" , " 262144" , " 1048576" , " 16777216" , " 4194304" })
295
+ dsproxyCounter += GetServiceCounters (appData->Counters , " dsproxynode" )->
296
+ GetSubgroup (" subsystem" , " request" )->
297
+ GetSubgroup (" storagePool" , env->StoragePoolName )->
298
+ GetSubgroup (" handleClass" , " PutTabletLog" )->
299
+ GetSubgroup (" sizeClass" , sizeClass)->
300
+ GetCounter (" generatedSubrequestBytes" )->Val ();
301
+ }
302
+ vdiskCounter = env->AggregateVDiskCountersWithHandleClass (env->StoragePoolName , groupSize, groupSize, groupId, pdiskLayout,
303
+ " PutTabletLog" , " requestBytes" );
304
+ if constexpr (VERBOSE) {
305
+ for (ui32 i = 1 ; i <= groupSize; ++i) {
306
+ Cerr << " ##################### Node " << i << " ##################### " << Endl;
307
+ env->Runtime ->GetNode (i)->AppData ->Counters ->OutputPlainText (Cerr);
308
+ }
309
+ }
310
+ UNIT_ASSERT (dsproxyCounter != 0 );
311
+ UNIT_ASSERT_VALUES_EQUAL (dsproxyCounter, vdiskCounter);
312
+ }
313
+
314
+
315
+ Y_UNIT_TEST_SUITE (TestDSProxyAndVDiskEqualByteCounters) {
316
+ Y_UNIT_TEST (MultiPut) {
317
+ auto actor = new TInflightActorPut ({10 , 10 }, 1000 , 10 );
318
+ TestDSProxyAndVDiskEqualByteCounters (actor);
319
+ }
320
+
321
+ Y_UNIT_TEST (SinglePut) {
322
+ auto actor = new TInflightActorPut ({1 , 1 }, 1000 );
323
+ TestDSProxyAndVDiskEqualByteCounters (actor);
324
+ }
325
+ }
326
+
286
327
#undef MAKE_BURST_TEST
0 commit comments