mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01:00
Add NodeJS statistics - part 1 - heap statistics
This commit is contained in:
parent
26826b6120
commit
790a82c4b1
3 changed files with 59 additions and 1 deletions
|
|
@ -65,3 +65,36 @@ template(name='statistics')
|
||||||
tr
|
tr
|
||||||
th {{_ 'OS_Cpus'}}
|
th {{_ 'OS_Cpus'}}
|
||||||
td {{statistics.os.cpus.length}}
|
td {{statistics.os.cpus.length}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_total_heap_size'}}
|
||||||
|
td {{bytesToSize statistics.nodeHeapStats.totalHeapSize}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_total_heap_size_executable'}}
|
||||||
|
td {{bytesToSize statistics.nodeHeapStats.totalHeapSizeExecutable}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_total_physical_size'}}
|
||||||
|
td {{bytesToSize statistics.nodeHeapStats.totalPhysicalSize}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_total_available_size'}}
|
||||||
|
td {{bytesToSize statistics.nodeHeapStats.totalAvailableSize}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_used_heap_size'}}
|
||||||
|
td {{bytesToSize statistics.nodeHeapStats.usedHeapSize}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_heap_size_limit'}}
|
||||||
|
td {{bytesToSize statistics.nodeHeapStats.heapSizeLimit}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_malloced_memory'}}
|
||||||
|
td {{bytesToSize statistics.nodeHeapStats.mallocedMemory}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_peak_malloced_memory'}}
|
||||||
|
td {{bytesToSize statistics.nodeHeapStats.peakMallocedMemory}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_does_zap_garbage'}}
|
||||||
|
td {{statistics.nodeHeapStats.doesZapGarbage}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_number_of_native_contexts'}}
|
||||||
|
td {{statistics.nodeHeapStats.numberOfNativeContexts}}
|
||||||
|
tr
|
||||||
|
th {{_ 'Node_heap_number_of_detached_contexts'}}
|
||||||
|
td {{statistics.nodeHeapStats.numberOfDetachedContexts}}
|
||||||
|
|
|
||||||
|
|
@ -1098,5 +1098,16 @@
|
||||||
"filter-card-title-label": "Filter by card title",
|
"filter-card-title-label": "Filter by card title",
|
||||||
"invite-people-success": "Invitation to register sent with success",
|
"invite-people-success": "Invitation to register sent with success",
|
||||||
"invite-people-error": "Error while sending invitation to register",
|
"invite-people-error": "Error while sending invitation to register",
|
||||||
"can-invite-if-same-mailDomainName": "Email domain name"
|
"can-invite-if-same-mailDomainName": "Email domain name",
|
||||||
|
"Node_heap_total_heap_size": "Node heap : total heap size",
|
||||||
|
"Node_heap_total_heap_size_executable": "Node heap : total heap size executable",
|
||||||
|
"Node_heap_total_physical_size": "Node heap : total physical size",
|
||||||
|
"Node_heap_total_available_size": "Node heap : total available size",
|
||||||
|
"Node_heap_used_heap_size": "Node heap : used heap size",
|
||||||
|
"Node_heap_heap_size_limit": "Node heap : heap size limit",
|
||||||
|
"Node_heap_malloced_memory": "Node heap : malloced memory",
|
||||||
|
"Node_heap_peak_malloced_memory": "Node heap : peak malloced memory",
|
||||||
|
"Node_heap_does_zap_garbage": "Node heap : does zap garbage",
|
||||||
|
"Node_heap_number_of_native_contexts": "Node heap : number of native contexts",
|
||||||
|
"Node_heap_number_of_detached_contexts": "Node heap : number of detached contexts"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,20 @@ if (Meteor.isServer) {
|
||||||
pid: process.pid,
|
pid: process.pid,
|
||||||
uptime: process.uptime(),
|
uptime: process.uptime(),
|
||||||
};
|
};
|
||||||
|
const v8 = require('v8'); // Import the v8 module
|
||||||
|
statistics.nodeHeapStats = {
|
||||||
|
totalHeapSize: v8.getHeapStatistics().total_heap_size,
|
||||||
|
totalHeapSizeExecutable: v8.getHeapStatistics().total_heap_size_executable,
|
||||||
|
totalPhysicalSize: v8.getHeapStatistics().total_physical_size,
|
||||||
|
totalAvailableSize: v8.getHeapStatistics().total_available_size,
|
||||||
|
usedHeapSize: v8.getHeapStatistics().used_heap_size,
|
||||||
|
heapSizeLimit: v8.getHeapStatistics().heap_size_limit,
|
||||||
|
mallocedMemory: v8.getHeapStatistics().malloced_memory,
|
||||||
|
peakMallocedMemory: v8.getHeapStatistics().peak_malloced_memory,
|
||||||
|
doesZapGarbage: v8.getHeapStatistics().does_zap_garbage,
|
||||||
|
numberOfNativeContexts: v8.getHeapStatistics().number_of_native_contexts,
|
||||||
|
numberOfDetachedContexts: v8.getHeapStatistics().number_of_detached_contexts,
|
||||||
|
};
|
||||||
// Remove beginning of Meteor release text METEOR@
|
// Remove beginning of Meteor release text METEOR@
|
||||||
let meteorVersion = Meteor.release;
|
let meteorVersion = Meteor.release;
|
||||||
meteorVersion = meteorVersion.replace('METEOR@', '');
|
meteorVersion = meteorVersion.replace('METEOR@', '');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue