diff options
| author | Daniil Cherednik <[email protected]> | 2022-09-21 20:17:38 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-09-21 20:17:38 +0300 |
| commit | e6c9b17192c56494adba359d5e132c431b241191 (patch) | |
| tree | 6f2449871a118a0e8919ce842b1174e06cb470ef /library/cpp/actors/core | |
| parent | 285021ab1aac39e84b269d9bacd4deee69cf63fc (diff) | |
Ydb stable 22-4-2122.4.21
x-stable-origin-commit: e89099581237299a132feafb5b58af59ebd0468a
Diffstat (limited to 'library/cpp/actors/core')
| -rw-r--r-- | library/cpp/actors/core/event_pb.h | 4 | ||||
| -rw-r--r-- | library/cpp/actors/core/log.cpp | 41 | ||||
| -rw-r--r-- | library/cpp/actors/core/log.h | 1 |
3 files changed, 15 insertions, 31 deletions
diff --git a/library/cpp/actors/core/event_pb.h b/library/cpp/actors/core/event_pb.h index 061e51fa686..2d388fceeb0 100644 --- a/library/cpp/actors/core/event_pb.h +++ b/library/cpp/actors/core/event_pb.h @@ -121,11 +121,7 @@ namespace NActors { bool Finished = false; }; -#ifdef ACTORLIB_HUGE_PB_SIZE static const size_t EventMaxByteSize = 140 << 20; // (140MB) -#else - static const size_t EventMaxByteSize = 67108000; -#endif template <typename TEv, typename TRecord /*protobuf record*/, ui32 TEventType, typename TRecHolder> class TEventPBBase: public TEventBase<TEv, TEventType> , public TRecHolder { diff --git a/library/cpp/actors/core/log.cpp b/library/cpp/actors/core/log.cpp index 5f63b5af580..4bafd458423 100644 --- a/library/cpp/actors/core/log.cpp +++ b/library/cpp/actors/core/log.cpp @@ -77,7 +77,7 @@ namespace NActors { HTML(str) { DIV_CLASS("row") { DIV_CLASS("col-md-12") { - H4() { + TAG(TH4) { str << "Counters" << Endl; } DynamicCounters->OutputHtml(str); @@ -142,7 +142,7 @@ namespace NActors { HTML(str) { DIV_CLASS("row") { DIV_CLASS("col-md-12") { - H4() { + TAG(TH4) { str << "Metrics" << Endl; } // TODO: Now, TMetricRegistry does not have the GetOutputHtml function @@ -164,8 +164,6 @@ namespace NActors { std::shared_ptr<NMonitoring::TMetricRegistry> Metrics; }; - TAtomic TLoggerActor::IsOverflow = 0; - TLoggerActor::TLoggerActor(TIntrusivePtr<NLog::TSettings> settings, TAutoPtr<TLogBackend> logBackend, TIntrusivePtr<NMonitoring::TDynamicCounters> counters) @@ -224,8 +222,9 @@ namespace NActors { } void TLoggerActor::Throttle(const NLog::TSettings& settings) { - if (AtomicGet(IsOverflow)) - Sleep(settings.ThrottleDelay); + // throttling via Sleep was removed since it causes unexpected + // incidents when users try to set AllowDrop=false. + Y_UNUSED(settings); } void TLoggerActor::LogIgnoredCount(TInstant now) { @@ -268,10 +267,6 @@ namespace NActors { i64 delayMillisec = (ctx.Now() - ev->Get()->Stamp).MilliSeconds(); WriteMessageStat(*ev->Get()); if (Settings->AllowDrop) { - // Disable throttling if it was enabled previously - if (AtomicGet(IsOverflow)) - AtomicSet(IsOverflow, 0); - // Check if some records have to be dropped if ((PassedCount > 10 && delayMillisec > (i64)Settings->TimeThresholdMs) || IgnoredCount > 0) { Metrics->IncIgnoredMsgs(); @@ -283,12 +278,6 @@ namespace NActors { return; } PassedCount++; - } else { - // Enable of disable throttling depending on the load - if (delayMillisec > (i64)Settings->TimeThresholdMs && !AtomicGet(IsOverflow)) - AtomicSet(IsOverflow, 1); - else if (delayMillisec <= (i64)Settings->TimeThresholdMs && AtomicGet(IsOverflow)) - AtomicSet(IsOverflow, 0); } const auto prio = ev->Get()->Level.ToPrio(); @@ -312,7 +301,7 @@ namespace NActors { void TLoggerActor::RenderComponentPriorities(IOutputStream& str) { using namespace NLog; HTML(str) { - H4() { + TAG(TH4) { str << "Priority Settings for the Components"; } TABLE_SORTABLE_CLASS("table") { @@ -415,7 +404,7 @@ namespace NActors { HTML(str) { DIV_CLASS("row") { DIV_CLASS("col-md-12") { - H4() { + TAG(TH4) { str << "Current log settings for " << Settings->ComponentName(component) << Endl; } UL() { @@ -437,7 +426,7 @@ namespace NActors { DIV_CLASS("row") { DIV_CLASS("col-md-12") { - H4() { + TAG(TH4) { str << "Change priority" << Endl; } UL() { @@ -448,7 +437,7 @@ namespace NActors { } } } - H4() { + TAG(TH4) { str << "Change sampling priority" << Endl; } UL() { @@ -459,7 +448,7 @@ namespace NActors { } } } - H4() { + TAG(TH4) { str << "Change sampling rate" << Endl; } str << "<form method=\"GET\">" << Endl; @@ -467,7 +456,7 @@ namespace NActors { str << "<input type=\"hidden\" name=\"c\" value=\"" << component << "\">" << Endl; str << "<input class=\"btn btn-primary\" type=\"submit\" value=\"Change\"/>" << Endl; str << "</form>" << Endl; - H4() { + TAG(TH4) { str << "<a href='logger'>Cancel</a>" << Endl; } } @@ -503,7 +492,7 @@ namespace NActors { RenderComponentPriorities(str); } DIV_CLASS("col-md-6") { - H4() { + TAG(TH4) { str << "Change priority for all components"; } TABLE_CLASS("table table-condensed") { @@ -525,7 +514,7 @@ namespace NActors { } } } - H4() { + TAG(TH4) { str << "Change sampling priority for all components"; } TABLE_CLASS("table table-condensed") { @@ -547,7 +536,7 @@ namespace NActors { } } } - H4() { + TAG(TH4) { str << "Change sampling rate for all components"; } str << "<form method=\"GET\">" << Endl; @@ -555,7 +544,7 @@ namespace NActors { str << "<input type=\"hidden\" name=\"c\" value=\"-1\">" << Endl; str << "<input class=\"btn btn-primary\" type=\"submit\" value=\"Change\"/>" << Endl; str << "</form>" << Endl; - H4() { + TAG(TH4) { str << "Drop log entries in case of overflow: " << (Settings->AllowDrop ? "Enabled" : "Disabled"); } diff --git a/library/cpp/actors/core/log.h b/library/cpp/actors/core/log.h index c11a7cf3c19..96cbb81958c 100644 --- a/library/cpp/actors/core/log.h +++ b/library/cpp/actors/core/log.h @@ -239,7 +239,6 @@ namespace NActors { std::shared_ptr<TLogBackend> LogBackend; ui64 IgnoredCount = 0; ui64 PassedCount = 0; - static TAtomic IsOverflow; TDuration WakeupInterval{TDuration::Seconds(5)}; std::unique_ptr<ILoggerMetrics> Metrics; |
