@@ -201,9 +201,7 @@ namespace NActors {
201201 bool wasWorking = false ;
202202 NHPTimer::STime hpnow = Ctx.HPStart ;
203203 NHPTimer::STime hpprev = TlsThreadContext->UpdateStartOfElapsingTime (hpnow);
204- if (Y_LIKELY (hpprev < hpnow)) {
205- Ctx.AddElapsedCycles (ActorSystemIndex, hpnow - hpprev);
206- }
204+ Ctx.AddElapsedCycles (ActorSystemIndex, hpnow - hpprev);
207205 NHPTimer::STime eventStart = Ctx.HPStart ;
208206
209207 for (; Ctx.ExecutedEvents < Ctx.EventsPerMailbox ; ++Ctx.ExecutedEvents ) {
@@ -268,9 +266,9 @@ namespace NActors {
268266 if (mailbox->IsEmpty ()) // was not-free and become free, we must reclaim mailbox
269267 reclaimAsFree = true ;
270268
271- if ( Y_LIKELY (hpprev < hpnow)) {
272- Ctx.AddEventProcessingStats (hpprev , hpnow, activityType, CurrentActorScheduledEventsCounter );
273- }
269+
270+ Ctx.AddElapsedCycles (activityType , hpnow - hpprev );
271+ Ctx. AddEventProcessingStats (eventStart, hpnow, activityType, CurrentActorScheduledEventsCounter);
274272 NHPTimer::STime elapsed = hpnow - eventStart;
275273 if (elapsed > 1000000 ) {
276274 LwTraceSlowEvent (ev.Get (), evTypeForTracing, actorType, Ctx.PoolId , CurrentRecipient, NHPTimer::GetSeconds (elapsed) * 1000.0 );
@@ -292,9 +290,7 @@ namespace NActors {
292290 }
293291 hpnow = GetCycleCountFast ();
294292 hpprev = TlsThreadContext->UpdateStartOfElapsingTime (hpnow);
295- if (Y_LIKELY (hpprev < hpnow)) {
296- Ctx.AddElapsedCycles (ActorSystemIndex, hpnow - hpprev);
297- }
293+ Ctx.AddElapsedCycles (ActorSystemIndex, hpnow - hpprev);
298294 }
299295 eventStart = hpnow;
300296
@@ -786,12 +782,10 @@ namespace NActors {
786782 NHPTimer::STime hpnow = GetCycleCountFast ();
787783 ui64 activityType = TlsThreadCtx.ElapsingActorActivity .load (std::memory_order_acquire);
788784 NHPTimer::STime hpprev = TlsThreadCtx.UpdateStartOfElapsingTime (hpnow);
789- if (Y_LIKELY (hpprev < hpnow)) {
790- if (activityType == Max<ui64>()) {
791- Ctx.AddParkedCycles (hpnow - hpprev);
792- } else {
793- Ctx.AddElapsedCycles (activityType, hpnow - hpprev);
794- }
785+ if (activityType == Max<ui64>()) {
786+ Ctx.AddParkedCycles (hpnow - hpprev);
787+ } else {
788+ Ctx.AddElapsedCycles (activityType, hpnow - hpprev);
795789 }
796790 Ctx.GetCurrentStats (statsCopy);
797791 }
@@ -800,12 +794,10 @@ namespace NActors {
800794 NHPTimer::STime hpnow = GetCycleCountFast ();
801795 ui64 activityType = TlsThreadCtx.ElapsingActorActivity .load (std::memory_order_acquire);
802796 NHPTimer::STime hpprev = TlsThreadCtx.UpdateStartOfElapsingTime (hpnow);
803- if (Y_LIKELY (hpprev < hpnow)) {
804- if (activityType == Max<ui64>()) {
805- Ctx.AddParkedCycles (hpnow - hpprev);
806- } else {
807- Ctx.AddElapsedCycles (activityType, hpnow - hpprev);
808- }
797+ if (activityType == Max<ui64>()) {
798+ Ctx.AddParkedCycles (hpnow - hpprev);
799+ } else {
800+ Ctx.AddElapsedCycles (activityType, hpnow - hpprev);
809801 }
810802 statsCopy = TExecutorThreadStats ();
811803 statsCopy.Aggregate (SharedStats[poolId]);
0 commit comments