Skip to content

Commit

Permalink
REFPLTV-504 : Modified Monitor plugin to return operational state eve…
Browse files Browse the repository at this point in the history
…n if there are no memory measurements.

(cherry picked from commit ba0ace1)
  • Loading branch information
Neeraj Deshpande authored and anand-ky committed Aug 25, 2020
1 parent f8db63b commit ddae1c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
7 changes: 2 additions & 5 deletions Monitor/Monitor.config
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,8 @@ if(ENABLE_OPEN_CDMI)
kv(operational 1)
key(restart)
map()
key(operational)
map()
kv(window 60)
kv(limit 3)
end()
kv(window 60)
kv(limit 3)
end()
end()
ans(OPENCDMI_MONITOR_CONFIG)
Expand Down
18 changes: 8 additions & 10 deletions Monitor/Monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -848,10 +848,12 @@ namespace Plugin {
info.Restart.Window = object.RestartWindow();
}

translate(metaData.Allocated(), &info.Measurements.Allocated);
translate(metaData.Resident(), &info.Measurements.Resident);
translate(metaData.Shared(), &info.Measurements.Shared);
translate(metaData.Process(), &info.Measurements.Process);
if (object.HasMeasurement()) {
translate(metaData.Allocated(), &info.Measurements.Allocated);
translate(metaData.Resident(), &info.Measurements.Resident);
translate(metaData.Shared(), &info.Measurements.Shared);
translate(metaData.Process(), &info.Measurements.Process);
}
info.Measurements.Operational = metaData.Operational();
info.Measurements.Count = metaData.Allocated().Measurements();

Expand All @@ -861,15 +863,11 @@ namespace Plugin {
if (callsign.empty() == false) {
auto element = _monitor.find(callsign);
if (element != _monitor.end()) {
if (element->second.HasMeasurement() == true) {
AddElement(element->first, element->second);
}
AddElement(element->first, element->second);
}
} else {
for (auto& element : _monitor) {
if (element.second.HasMeasurement() == true) {
AddElement(element.first, element.second);
}
AddElement(element.first, element.second);
}
}

Expand Down

0 comments on commit ddae1c6

Please sign in to comment.