Skip to content

Commit

Permalink
Merge pull request #228 from OpenAF/20240326-011542
Browse files Browse the repository at this point in the history
Update package
  • Loading branch information
nmaguiar authored Mar 26, 2024
2 parents b842df4 + 5b22286 commit 0145717
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/version.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions .package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ name: nAttrMon
main: nattrmon.js
mainJob: ''
license: Apache 2.0 license
version: '20240312'
version: '20240325'
dependencies:
openaf: '>=20230704'
files:
Expand Down Expand Up @@ -306,7 +306,7 @@ filesHash:
config/inputs.disabled/yaml/05.files.processederror.day.yaml: 18768bbe3b18c494225cedd51b3a77480736ad24
config/inputs.disabled/yaml/05.files.processederror.hour.yaml: 46178a8c2d8f7aa6e4d63cb1f7e1aeee0c92d3ce
config/inputs.disabled/yaml/05.files.processing.backlog.yaml: f6ed2a18301a91d1a7ce33d9881299dbffcc4b07
config/inputs.disabled/yaml/09.memory.yaml: 7f25e9591f3bc16d3181a56a92b1100709afccd3
config/inputs.disabled/yaml/09.memory.yaml: f1e99c65560e502d264f97192f391e318e7b9fec
config/inputs.disabled/yaml/10.filesystem.yaml: e8b8a6149c8f32128cd3c601081f6f67b3822e70
config/inputs.disabled/yaml/10.filesystemcount.fixed.yaml: b36490b7dfa1794602a46c108e915d3bc45d55f8
config/inputs.disabled/yaml/10.filesystemcount.mobsubscribers.yaml: 7a606e7180296c916b585bac13313452ca73840d
Expand Down Expand Up @@ -411,7 +411,7 @@ filesHash:
config/objects/nInput_OpenMetrics.js: 67c90bf64c35d639499c7bbf8273af715050ee5d
config/objects/nInput_RAIDGCMemory.js: 28aefad8696236df00e681ea00d85679d9481a9f
config/objects/nInput_RAIDLookups.js: 9a56cb2550a5c254097337f4da7191f58a685caa
config/objects/nInput_RAIDMemory.js: 23ed9e4d91613c7a479a512e1dbc1a13cf971c23
config/objects/nInput_RAIDMemory.js: 5348b1917c698d5fcbb8b56cd6553a657af81bb8
config/objects/nInput_RAIDStatus_DB.js: ff3e9eeeecc7092e855000ce3a90181f297f46c4
config/objects/nInput_RemoteChannel.js: 42b87110cc2a584907920c79c2ddfb49c1e92383
config/objects/nInput_RunningFlows.js: 7d8d77a702b4f9f2f719679052cba240798fa5f8
Expand Down
3 changes: 2 additions & 1 deletion config/inputs.disabled/yaml/09.memory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ input:
onlyOnEvent : true
execFrom : nInput_RAIDMemory
execArgs :
chKeys : raidServers
chKeys : raidServers
#extraMemoryDetails: true
16 changes: 12 additions & 4 deletions config/objects/nInput_RAIDMemory.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ var nInput_RAIDMemory = function(anMonitoredAFObjectKey, attributePrefix) {
if (isUnDef(this.params.attrTemplate))
this.params.attrTemplate = "Server status/Memory";

this.params.extraMemoryDetails = _$(this.params.extraMemoryDetails).isBoolean().default(false)
if (this.params.extraMemoryDetails) {
this._args = { ShowMemoryDetails: true }
} else {
this._args = { }
}

if (isUnDef(this.params.extra)) this.params.extra = [];

} else {
Expand Down Expand Up @@ -62,13 +69,14 @@ nInput_RAIDMemory.prototype.__getMemory = function(aKey, aExtra) {
var mems;
var parent = this;
if (isString(parent.params.useCache)) {
var res = $cache("nattrmon::" + parent.params.useCache + "::" + aKey).get({ op: "StatusReport", args: {} });
var res = $cache("nattrmon::" + parent.params.useCache + "::" + aKey).get({ op: "StatusReport", args: this._args })
if (isMap(res) && isDef(res.__error)) throw res.__error;
mems = res.MemoryInfo;
} else {
var parent = this
nattrmon.useObject(aKey, function(s) {
try {
mems = s.exec("StatusReport", {}).MemoryInfo;
mems = s.exec("StatusReport", parent._args).MemoryInfo
} catch(e) {
logErr("Error while retrieving memory using '" + aKey + "': " + e.message);
throw e;
Expand All @@ -85,9 +93,9 @@ nInput_RAIDMemory.prototype.__getMemory = function(aKey, aExtra) {
}

if(!this.params.single) {
ret = {"Free heap (MB)": freemem, "Used heap (MB)": usedmem, "Total heap (MB)": totalmem, "Max memory (MB)": maxmem};
ret = {"Free heap (MB)": freemem, "Used heap (MB)": usedmem, "Total heap (MB)": totalmem, "Max memory (MB)": maxmem, "GCCollectors": mems.GCCollectors, "GCSpaces": mems.GCSpaces};
} else {
ret = {"Name": aKey, "Free heap (MB)": freemem, "Used heap (MB)": usedmem, "Total heap (MB)": totalmem, "Max memory (MB)": maxmem};
ret = {"Name": aKey, "Free heap (MB)": freemem, "Used heap (MB)": usedmem, "Total heap (MB)": totalmem, "Max memory (MB)": maxmem, "GCCollectors": mems.GCCollectors, "GCSpaces": mems.GCSpaces};
ret = merge(ret, aExtra);
}

Expand Down

0 comments on commit 0145717

Please sign in to comment.