@@ -195,6 +195,37 @@ namespace NKikimr::NBlobDepot {
195
195
TActorId PipeServerId;
196
196
bool IsConnected = false ;
197
197
198
+ NMonitoring::TDynamicCounterPtr AgentCounters;
199
+
200
+ NMonitoring::TDynamicCounters::TCounterPtr ModeConnectPending;
201
+ NMonitoring::TDynamicCounters::TCounterPtr ModeRegistering;
202
+ NMonitoring::TDynamicCounters::TCounterPtr ModeConnected;
203
+
204
+ NMonitoring::TDynamicCounters::TCounterPtr PendingEventQueueItems;
205
+ NMonitoring::TDynamicCounters::TCounterPtr PendingEventQueueBytes;
206
+
207
+ THashMap<ui32, NMonitoring::TDynamicCounters::TCounterPtr> RequestsReceived;
208
+ THashMap<ui32, NMonitoring::THistogramPtr> SuccessResponseTime;
209
+ THashMap<ui32, NMonitoring::THistogramPtr> ErrorResponseTime;
210
+
211
+ NMonitoring::TDynamicCounters::TCounterPtr S3GetBytesOk;
212
+ NMonitoring::TDynamicCounters::TCounterPtr S3GetsOk;
213
+ NMonitoring::TDynamicCounters::TCounterPtr S3GetsError;
214
+ NMonitoring::TDynamicCounters::TCounterPtr S3PutBytesOk;
215
+ NMonitoring::TDynamicCounters::TCounterPtr S3PutsOk;
216
+ NMonitoring::TDynamicCounters::TCounterPtr S3PutsError;
217
+
218
+ enum class EMode {
219
+ None,
220
+ ConnectPending,
221
+ Registering,
222
+ Connected
223
+ };
224
+
225
+ EMode Mode = EMode::None;
226
+
227
+ void SwitchMode (EMode mode);
228
+
198
229
private:
199
230
struct TEvPrivate {
200
231
enum {
@@ -258,6 +289,9 @@ namespace NKikimr::NBlobDepot {
258
289
259
290
void PassAway () override {
260
291
ClearPendingEventQueue (" BlobDepot agent destroyed" );
292
+ if (AgentCounters) {
293
+ GetServiceCounters (AppData ()->Counters , " blob_depot_agent" )->RemoveSubgroup (" group" , ::ToString (VirtualGroupId));
294
+ }
261
295
NTabletPipe::CloseAndForgetClient (SelfId (), PipeId);
262
296
if (S3WrapperId) {
263
297
TActivationContext::Send (new IEventHandle (TEvents::TSystem::Poison, 0 , S3WrapperId, SelfId (), nullptr , 0 ));
@@ -332,6 +366,7 @@ namespace NKikimr::NBlobDepot {
332
366
333
367
void Handle (TEvTabletPipe::TEvClientConnected::TPtr ev);
334
368
void Handle (TEvTabletPipe::TEvClientDestroyed::TPtr ev);
369
+ void SetupCounters ();
335
370
void ConnectToBlobDepot ();
336
371
void OnConnect ();
337
372
void OnDisconnect ();
@@ -361,6 +396,7 @@ namespace NKikimr::NBlobDepot {
361
396
{
362
397
protected:
363
398
std::unique_ptr<IEventHandle> Event; // original query event
399
+ const TMonotonic Received;
364
400
const ui64 QueryId;
365
401
mutable TString QueryIdString;
366
402
const TMonotonic StartTime;
@@ -373,7 +409,7 @@ namespace NKikimr::NBlobDepot {
373
409
static constexpr TDuration WatchdogDuration = TDuration::Seconds(10 );
374
410
375
411
public:
376
- TQuery (TBlobDepotAgent& agent, std::unique_ptr<IEventHandle> event);
412
+ TQuery (TBlobDepotAgent& agent, std::unique_ptr<IEventHandle> event, TMonotonic received );
377
413
virtual ~TQuery ();
378
414
379
415
void CheckQueryExecutionTime (TMonotonic now);
@@ -422,8 +458,8 @@ namespace NKikimr::NBlobDepot {
422
458
template <typename TEvent>
423
459
class TBlobStorageQuery : public TQuery {
424
460
public:
425
- TBlobStorageQuery (TBlobDepotAgent& agent, std::unique_ptr<IEventHandle> event)
426
- : TQuery(agent, std::move(event))
461
+ TBlobStorageQuery (TBlobDepotAgent& agent, std::unique_ptr<IEventHandle> event, TMonotonic received )
462
+ : TQuery(agent, std::move(event), received )
427
463
, Request(*Event->Get<TEvent>())
428
464
{
429
465
ExecutionRelay = std::move (Request.ExecutionRelay );
@@ -437,6 +473,7 @@ namespace NKikimr::NBlobDepot {
437
473
std::unique_ptr<IEventHandle> Event;
438
474
size_t Size ;
439
475
TMonotonic ExpirationTimestamp;
476
+ TMonotonic Received;
440
477
};
441
478
442
479
std::deque<TPendingEvent> PendingEventQ;
@@ -448,13 +485,13 @@ namespace NKikimr::NBlobDepot {
448
485
TIntrusiveListWithAutoDelete<TQuery, TQuery::TDeleter, TExecutingQueries> DeletePendingQueries;
449
486
bool ProcessPendingEventInFlight = false ;
450
487
451
- template <ui32 EventType> TQuery *CreateQuery (std::unique_ptr<IEventHandle> ev);
488
+ template <ui32 EventType> TQuery *CreateQuery (std::unique_ptr<IEventHandle> ev, TMonotonic received );
452
489
void HandleStorageProxy (TAutoPtr<IEventHandle> ev);
453
490
void HandleAssimilate (TAutoPtr<IEventHandle> ev);
454
491
void HandlePendingEvent ();
455
492
void HandleProcessPendingEvent ();
456
493
void ClearPendingEventQueue (const TString& reason);
457
- void ProcessStorageEvent (std::unique_ptr<IEventHandle> ev);
494
+ void ProcessStorageEvent (std::unique_ptr<IEventHandle> ev, TMonotonic received );
458
495
void HandlePendingEventQueueWatchdog ();
459
496
void Handle (TEvBlobStorage::TEvBunchOfEvents::TPtr ev);
460
497
void HandleQueryWatchdog ();
0 commit comments