Commit 84912da1 authored by Alessio Netti's avatar Alessio Netti
Browse files

DCDBPusher: minor fixes

- Fixed "average" REST API command for negative values
- Fixed indentation in ProcFS plugin
parent 6e63322a
......@@ -164,7 +164,7 @@ void RestAPI::GET_average(endpointArgs) {
for (const auto &g : p.configurator->getSensorGroups()) {
for (const auto &s : g->acquireSensors()) {
if (s->getName() == sensor && s->isInit()) {
uint64_t avg = 0;
int64_t avg = 0;
try {
avg = s->getCache()->getAverage(S_TO_NS(time));
} catch (const std::exception &e) {
......@@ -194,7 +194,7 @@ void RestAPI::GET_average(endpointArgs) {
for (const auto &u : op->getUnits()) {
for (const auto &s : u->getBaseOutputs()) {
if (s->getName() == sensor && s->isInit()) {
uint64_t avg = 0;
int64_t avg = 0;
try {
avg = s->getCache()->getAverage(S_TO_NS(time));
} catch (const std::exception &e) {
......
......@@ -81,9 +81,9 @@ class ProcfsSensorBase : public SensorBase {
void printConfig(LOG_LEVEL ll, LOGGER &lg, unsigned leadingSpaces = 16) {
std::string leading(leadingSpaces, ' ');
LOG_VAR(ll) << leading << " Metric: " << _metric;
LOG_VAR(ll) << leading << " CPU Id: " << _cpuId;
LOG_VAR(ll) << leading << " PerCPU: " << (_perCPU ? "enabled" : "disabled");
LOG_VAR(ll) << leading << " Metric: " << _metric;
LOG_VAR(ll) << leading << " CPU Id: " << _cpuId;
LOG_VAR(ll) << leading << " PerCPU: " << (_perCPU ? "enabled" : "disabled");
}
protected:
......
......@@ -142,9 +142,9 @@ void ProcfsSensorGroup::read() {
void ProcfsSensorGroup::printGroupConfig(LOG_LEVEL ll, unsigned leadingSpaces) {
std::string leading(leadingSpaces, ' ');
LOG_VAR(ll) << leading << "Type: " << _type;
LOG_VAR(ll) << leading << "Path: " << _path;
LOG_VAR(ll) << leading << "HTVal: " << _htVal;
LOG_VAR(ll) << leading << "Scaling: " << _scalingFactor;
LOG_VAR(ll) << leading << "Parser: " << (_parser ? "true" : "false");
LOG_VAR(ll) << leading << "Type: " << _type;
LOG_VAR(ll) << leading << "Path: " << _path;
LOG_VAR(ll) << leading << "HTVal: " << _htVal;
LOG_VAR(ll) << leading << "Scaling: " << _scalingFactor;
LOG_VAR(ll) << leading << "Parser: " << (_parser ? "true" : "false");
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment