mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 10:22:10 +00:00
More decorative fixes
This commit is contained in:
parent
067ec0855c
commit
6bf0840562
@ -16,18 +16,18 @@ namespace DB
|
||||
|
||||
namespace
|
||||
{
|
||||
template<typename T>
|
||||
void readIntTextAndSkipWhitespaceIfAny(T & x, ReadBuffer & buf)
|
||||
{
|
||||
template<typename T>
|
||||
void readIntTextAndSkipWhitespaceIfAny(T & x, ReadBuffer & buf)
|
||||
{
|
||||
readIntText(x, buf);
|
||||
skipWhitespaceIfAny(buf);
|
||||
}
|
||||
}
|
||||
|
||||
void readStringUntilWhitespaceAndSkipWhitespaceIfAny(String & s, ReadBuffer & buf)
|
||||
{
|
||||
void readStringUntilWhitespaceAndSkipWhitespaceIfAny(String & s, ReadBuffer & buf)
|
||||
{
|
||||
readStringUntilWhitespace(s, buf);
|
||||
skipWhitespaceIfAny(buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static constexpr auto meminfo_filename = "/proc/meminfo";
|
||||
|
@ -23,36 +23,36 @@ namespace DB
|
||||
|
||||
namespace
|
||||
{
|
||||
template<typename T>
|
||||
void readIntTextAndSkipWhitespaceIfAny(T & x, ReadBuffer & buf)
|
||||
{
|
||||
template<typename T>
|
||||
void readIntTextAndSkipWhitespaceIfAny(T & x, ReadBuffer & buf)
|
||||
{
|
||||
readIntText(x, buf);
|
||||
skipWhitespaceIfAny(buf);
|
||||
}
|
||||
}
|
||||
|
||||
void readStringAndSkipWhitespaceIfAny(String & s, ReadBuffer & buf)
|
||||
{
|
||||
void readStringAndSkipWhitespaceIfAny(String & s, ReadBuffer & buf)
|
||||
{
|
||||
readString(s, buf);
|
||||
skipWhitespaceIfAny(buf);
|
||||
}
|
||||
}
|
||||
|
||||
void readStringUntilWhitespaceAndSkipWhitespaceIfAny(String & s, ReadBuffer & buf)
|
||||
{
|
||||
void readStringUntilWhitespaceAndSkipWhitespaceIfAny(String & s, ReadBuffer & buf)
|
||||
{
|
||||
readStringUntilWhitespace(s, buf);
|
||||
skipWhitespaceIfAny(buf);
|
||||
}
|
||||
}
|
||||
|
||||
void readCharAndSkipWhitespaceIfAny(char & c, ReadBuffer & buf)
|
||||
{
|
||||
void readCharAndSkipWhitespaceIfAny(char & c, ReadBuffer & buf)
|
||||
{
|
||||
readChar(c, buf);
|
||||
skipWhitespaceIfAny(buf);
|
||||
}
|
||||
}
|
||||
|
||||
void readFloatAndSkipWhitespaceIfAny(float & f, ReadBuffer & buf)
|
||||
{
|
||||
void readFloatAndSkipWhitespaceIfAny(float & f, ReadBuffer & buf)
|
||||
{
|
||||
readFloatText(f, buf);
|
||||
skipWhitespaceIfAny(buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static constexpr auto loadavg_filename = "/proc/loadavg";
|
||||
@ -140,7 +140,8 @@ void ProcessorStatisticsOS::readProcTimeAndProcesses(ProcTime & proc_time, ProcS
|
||||
proc_time.guest /= USER_HZ;
|
||||
proc_time.guest_nice /= USER_HZ;
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
readStringUntilWhitespaceAndSkipWhitespaceIfAny(field_name, procst_in);
|
||||
readStringAndSkipWhitespaceIfAny(field_val, procst_in);
|
||||
} while (field_name != String("processes"));
|
||||
@ -163,8 +164,10 @@ void ProcessorStatisticsOS::readFreq(ProcFreq & freq)
|
||||
int cpu_count = 0;
|
||||
freq.max = freq.min = freq.avg = 0;
|
||||
|
||||
do {
|
||||
do {
|
||||
do
|
||||
{
|
||||
do
|
||||
{
|
||||
readStringAndSkipWhitespaceIfAny(field_name, cpuinfo_in);
|
||||
} while (!cpuinfo_in.eof() && field_name != String("cpu MHz"));
|
||||
|
||||
|
@ -18,7 +18,6 @@ namespace DB
|
||||
class ProcessorStatisticsOS
|
||||
{
|
||||
public:
|
||||
|
||||
struct ProcLoadavg
|
||||
{
|
||||
float avg1;
|
||||
|
Loading…
Reference in New Issue
Block a user