|
2 | 2 | #include <ydb/core/tx/limiter/grouped_memory/service/counters.h> |
3 | 3 |
|
4 | 4 | #include <ydb/library/accessor/accessor.h> |
| 5 | +#include <ydb/library/accessor/positive_integer.h> |
5 | 6 | #include <ydb/library/actors/core/actor.h> |
6 | 7 | #include <ydb/library/actors/core/actorid.h> |
7 | 8 | #include <ydb/library/actors/core/log.h> |
@@ -75,23 +76,6 @@ class TAllocationGuard { |
75 | 76 | ~TAllocationGuard(); |
76 | 77 | }; |
77 | 78 |
|
78 | | -class TPositiveControlInteger { |
79 | | -private: |
80 | | - ui64 Value = 0; |
81 | | - |
82 | | -public: |
83 | | - void Add(const ui64 value) { |
84 | | - Value += value; |
85 | | - } |
86 | | - void Sub(const ui64 value) { |
87 | | - AFL_VERIFY(value <= Value)("base", Value)("delta", value); |
88 | | - Value -= value; |
89 | | - } |
90 | | - ui64 Val() const { |
91 | | - return Value; |
92 | | - } |
93 | | -}; |
94 | | - |
95 | 79 | class TStageFeatures { |
96 | 80 | private: |
97 | 81 | YDB_READONLY_DEF(TString, Name); |
@@ -130,9 +114,9 @@ class TStageFeatures { |
130 | 114 | if (HardLimit < Usage.Val() + volume) { |
131 | 115 | Counters->OnCannotAllocate(); |
132 | 116 | AFL_DEBUG(NKikimrServices::GROUPED_MEMORY_LIMITER)("name", Name)("event", "cannot_allocate")("limit", HardLimit)( |
133 | | - "usage", Usage.Val())( |
134 | | - "delta", volume); |
135 | | - return TConclusionStatus::Fail(TStringBuilder() << Name << "::(limit:" << HardLimit << ";val:" << Usage.Val() << ";delta=" << volume << ");"); |
| 117 | + "usage", Usage.Val())("delta", volume); |
| 118 | + return TConclusionStatus::Fail( |
| 119 | + TStringBuilder() << Name << "::(limit:" << HardLimit << ";val:" << Usage.Val() << ";delta=" << volume << ");"); |
136 | 120 | } |
137 | 121 | Usage.Add(volume); |
138 | 122 | AFL_DEBUG(NKikimrServices::GROUPED_MEMORY_LIMITER)("name", Name)("event", "allocate")("usage", Usage.Val())("delta", volume); |
|
0 commit comments