stkvtflw
stkvtflw

Reputation: 13507

NodeJS app performance logs

Is there some kind of built in option, which will make nodejs log info about performance into a file.
Something like:

node --log-performance server.js

if not, then could you advice a tool, which will help me to get info about my app performance?

Upvotes: 0

Views: 206

Answers (2)

Brian
Brian

Reputation: 1036

I created a logging modules scribbles that you can drop in. That works similarly to Console.

You would be interested in the performance-monitoring feature.

It will give you, out of the box

  • state: the state of the services. e.g. "up", "blocking"
  • cpu: CPU info
    • cores: number of available cores
    • model: description of the processor
    • speed: MHz frequency speed
    • percUsed: load on process as percentage
    • percFree: available on process as percentage
  • sys: System info
    • startedAt: when it's system was started
    • arch: platform architecture. e.g "x64"
    • platform: the operating system platform
    • totalMem: the total megabytes of memory being used
    • freeMem: the total megabytes of memory free
    • usedMem: the total megabytes of memory being used
  • process:
    • percUsedCpu: the percentage of processing power being used by this process
    • percFreeMem: the percentage of memory being used by this process
    • usedMem: the total megabytes of memory being used by this process
    • startedAt: when it's process was started
    • pTitle: the current process title (i.e. returns the current value of ps)
    • pid: the ID of the process
    • ppid: the ID of the current parent process
    • user: node the name of the user who started node
    • vNode: version of node
  • network: Networking info
    • port: listening on this Port
    • connections: number of current established connections

Upvotes: 0

AJS
AJS

Reputation: 2023

There are tools out there you can use to profile your application,

Here is a nice blog explaining it all

If it is memory leaks that you want to find i just run the app on node-inspector and debug it using chrome DEV tools by taking a heap snapshot and analyzing it.

Upvotes: 0

Related Questions