Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions client/src/app/client_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ int ClientApp::Run()
{
stopped = 0;

struct sigaction action
{
}, old_int{}, old_term{};
struct sigaction action{}, old_int{}, old_term{};

action.sa_handler = OnSignal;
::sigemptyset(&action.sa_mask);
Expand Down
6 changes: 2 additions & 4 deletions server/src/collectors/linux_samples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ std::optional<ProcessSample> ParseProcess(std::string_view text)
std::int64_t rss{};

if (fields[0].size() != 1 || !Parse(fields[11], user) || !Parse(fields[12], system) ||
!Parse(fields[17], s.threads) || !Parse(fields[19], s.starttime) ||
!Parse(fields[21], rss))
!Parse(fields[17], s.threads) || !Parse(fields[19], s.starttime) || !Parse(fields[21], rss))
{
return std::nullopt;
}
Expand Down Expand Up @@ -221,8 +220,7 @@ models::PressureMetrics ParsePressure(std::string resource, std::string_view tex
auto key = token.substr(0, equal);
double n{};

if (!Parse(token.substr(equal + 1), n) || !std::isfinite(n) ||
n < 0 || n > 100)
if (!Parse(token.substr(equal + 1), n) || !std::isfinite(n) || n < 0 || n > 100)
{
continue;
}
Expand Down
4 changes: 1 addition & 3 deletions server/src/collectors/metrics_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,7 @@ void MetricsCollector::Disk(models::SystemSnapshot& s)

void MetricsCollector::Filesystem(models::SystemSnapshot& s)
{
struct statvfs st
{
};
struct statvfs st{};

int ec = source_->Filesystem(st);

Expand Down
4 changes: 1 addition & 3 deletions server/src/system/linux_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ int LinuxSource::Filesystem(struct statvfs& result) const

std::string LinuxSource::CgroupIdentity() const
{
struct stat st
{
};
struct stat st{};

if (::stat(config_.cgroup_path.c_str(), &st) != 0)
{
Expand Down
4 changes: 1 addition & 3 deletions server/src/transport/reactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,7 @@ std::string Reactor::Diagnostics(bool prometheus) const
}
json::Object o;

struct rusage usage
{
};
struct rusage usage{};

if (::getrusage(RUSAGE_SELF, &usage) == 0)
{
Expand Down
3 changes: 2 additions & 1 deletion tests/core/test_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ void TestJsonOwnershipAndLimits()

void TestCpu()
{
auto sample = ParseCpu("cpu 10\t20 30 40 50 60 70 80 9000 9000\r\n\ncpu7 1 2 3 4 5 6 7 8 \n");
auto sample =
ParseCpu("cpu 10\t20 30 40 50 60 70 80 9000 9000\r\n\ncpu7 1 2 3 4 5 6 7 8 \n");
CHECK(sample.size() == 2);
CHECK(sample.contains(7));
CHECK(sample[-1][7] == 80);
Expand Down
Loading