fix the count of mod over limit

This commit is contained in:
obdev
2024-02-09 09:21:28 +00:00
committed by ob-robot
parent 4656d6cb08
commit 952395e38e
2 changed files with 8 additions and 7 deletions

View File

@ -78,12 +78,13 @@ struct LabelItem
MEMSET(this, 0 , sizeof(*this));
}
char str_[lib::AOBJECT_LABEL_SIZE + 1];
int str_len_;
int32_t str_len_;
int32_t count_;
int32_t block_cnt_;
int32_t chunk_cnt_;
int64_t hold_;
int64_t used_;
int64_t count_;
int64_t block_cnt_;
int64_t chunk_cnt_;
LabelItem &operator +=(const LabelItem &item)
{
hold_ += item.hold_;
@ -123,7 +124,7 @@ static const int PRINT_BUF_LEN = 1L << 20;
static const int64_t MAX_MEMORY = 1L << 40; // 1T
static const int MAX_CHUNK_CNT = MAX_MEMORY / (2L << 20);
static const int MAX_TENANT_CNT = OB_MAX_SERVER_TENANT_CNT;
static const int MAX_LABEL_ITEM_CNT = 16L << 10;
static const int MAX_LABEL_ITEM_CNT = 64L << 10;
static const int64_t STAT_LABEL_INTERVAL = 10L * 1000L * 1000L;
static const int64_t LOG_BUF_LEN = 64L << 10;

View File

@ -137,7 +137,7 @@ void ObTenantCtxAllocator::print_usage() const
if (l_item->count_ != 0) {
ret = databuff_printf(
buf, BUFLEN, pos,
"[MEMORY] hold=% '15ld used=% '15ld count=% '8ld avg_used=% '15ld block_cnt=% '8ld chunk_cnt=% '8ld mod=%s\n",
"[MEMORY] hold=% '15ld used=% '15ld count=% '8d avg_used=% '15ld block_cnt=% '8d chunk_cnt=% '8d mod=%s\n",
l_item->hold_, l_item->used_, l_item->count_, l_item->used_ / l_item->count_, l_item->block_cnt_, l_item->chunk_cnt_,
label.str_);
}
@ -147,7 +147,7 @@ void ObTenantCtxAllocator::print_usage() const
if (OB_SUCC(ret) && sum_item.count_ > 0) {
ret = databuff_printf(
buf, BUFLEN, pos,
"[MEMORY] hold=% '15ld used=% '15ld count=% '8ld avg_used=% '15ld mod=%s\n",
"[MEMORY] hold=% '15ld used=% '15ld count=% '8d avg_used=% '15ld mod=%s\n",
sum_item.hold_, sum_item.used_, sum_item.count_,
sum_item.used_ / sum_item.count_,
"SUMMARY");