Created
June 14, 2019 15:00
-
-
Save smockle/4b9e52169310a57ac31b401d2275f3eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// @ts-check | |
const geoip = require('geoip-lite'); | |
function memoryUsageInMegabytes() { | |
const memoryUsageInBytes = process.memoryUsage(); | |
const memoryUsageInMegabytes = {}; | |
for (const key in memoryUsageInBytes) { | |
memoryUsageInMegabytes[key] = `${(memoryUsageInBytes[key] / 1000000).toFixed(2)}MB`; | |
} | |
return memoryUsageInMegabytes; | |
} | |
console.log(memoryUsageInMegabytes()); | |
console.log("For an explanation of these values, see https://nodejs.org/api/process.html#process_process_memoryusage"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// @ts-check | |
const geoip = require('geoip-ultralight'); | |
function memoryUsageInMegabytes() { | |
const memoryUsageInBytes = process.memoryUsage(); | |
const memoryUsageInMegabytes = {}; | |
for (const key in memoryUsageInBytes) { | |
memoryUsageInMegabytes[key] = `${(memoryUsageInBytes[key] / 1000000).toFixed(2)}MB`; | |
} | |
return memoryUsageInMegabytes; | |
} | |
console.log(memoryUsageInMegabytes()); | |
console.log("For an explanation of these values, see https://nodejs.org/api/process.html#process_process_memoryusage"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
Results: