statistics.js 611 B

1234567891011121314151617181920212223242526
  1. Meteor.methods({
  2. getStatistics() {
  3. const os = require('os');
  4. const pjson = require('/package.json');
  5. const statistics = {};
  6. statistics.version = pjson.version;
  7. statistics.os = {
  8. type: os.type(),
  9. platform: os.platform(),
  10. arch: os.arch(),
  11. release: os.release(),
  12. uptime: os.uptime(),
  13. loadavg: os.loadavg(),
  14. totalmem: os.totalmem(),
  15. freemem: os.freemem(),
  16. cpus: os.cpus(),
  17. };
  18. statistics.process = {
  19. nodeVersion: process.version,
  20. pid: process.pid,
  21. uptime: process.uptime(),
  22. };
  23. return statistics;
  24. },
  25. });