mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-14 19:45:11 +00:00
Fix error.
This commit is contained in:
parent
88ce78a7be
commit
1bb685a081
@ -906,7 +906,7 @@ void AsynchronousMetrics::update(TimePoint update_time)
|
||||
}
|
||||
|
||||
if (cgroupmem_limit_in_bytes && cgroupmem_usage_in_bytes)
|
||||
updateCgroupMemoryMetrics(cgroupmem_limit_in_bytes, cgroupmem_usage_in_bytes);
|
||||
updateCgroupMemoryMetrics(*cgroupmem_limit_in_bytes, *cgroupmem_usage_in_bytes);
|
||||
|
||||
if (meminfo)
|
||||
{
|
||||
@ -1478,18 +1478,18 @@ void AsynchronousMetrics::update(TimePoint update_time)
|
||||
values = new_values;
|
||||
}
|
||||
|
||||
void AsynchronousMetrics::updateCgroupMemoryMetrics(std::optional<ReadBufferFromFilePRead> memory_limit_in, std::optional<ReadBufferFromFilePRead> memory_usage_in)
|
||||
void AsynchronousMetrics::updateCgroupMemoryMetrics(ReadBufferFromFilePRead & memory_limit_in, ReadBufferFromFilePRead & memory_usage_in)
|
||||
{
|
||||
try
|
||||
{
|
||||
memory_limit_in->rewind();
|
||||
memory_usage_in->rewind();
|
||||
memory_limit_in.rewind();
|
||||
memory_usage_in.rewind();
|
||||
|
||||
uint64_t cgroup_mem_limit_in_bytes = 0;
|
||||
uint64_t cgroup_mem_usage_in_bytes = 0;
|
||||
|
||||
tryReadText(cgroup_mem_limit_in_bytes, *memory_limit_in);
|
||||
tryReadText(cgroup_mem_usage_in_bytes, *memory_usage_in);
|
||||
tryReadText(cgroup_mem_limit_in_bytes, memory_limit_in);
|
||||
tryReadText(cgroup_mem_usage_in_bytes, memory_usage_in);
|
||||
|
||||
new_values["CgroupMemoryTotal"] = { cgroup_mem_limit_in_bytes, "The total amount of memory in cgroup, in bytes. If stated zero, the limit is the same as OSMemoryTotal." };
|
||||
new_values["CgroupMemoryUsed"] = { cgroup_mem_usage_in_bytes, "The amount of memory used in cgroup, in bytes." };
|
||||
|
@ -202,7 +202,7 @@ private:
|
||||
void openBlockDevices();
|
||||
void openSensorsChips();
|
||||
void openEDAC();
|
||||
void updateCgroupMemoryMetrics(std::optional<ReadBufferFromFilePRead> memoryLimitReadBuffer, std::optional<ReadBufferFromFilePRead> memoryUsageReadBuffer);
|
||||
void updateCgroupMemoryMetrics(ReadBufferFromFilePRead & memory_limit_in, ReadBufferFromFilePRead & memory_usage_in);
|
||||
#endif
|
||||
|
||||
std::unique_ptr<ThreadFromGlobalPool> thread;
|
||||
|
Loading…
Reference in New Issue
Block a user