API Docs for: 2.0.0

Class PerformanceManager

Class defined in: src/node-performancemanager.js:27
PerformanceManager( )
src/node-performancemanager.js:27
addDisplayClient( idx, data )
src/node-performancemanager.js:130

Adds data for a display client.

Parameters:
  • idx <>

    The client ID

  • data <>

    The data

collectCPULoad( data )
src/node-performancemanager.js:210

Gets current CPU load and adds it to a list collected over time

  • also computes moving averages of 1 minute and a longer duration (5 minutes)
Parameters:
collectMemoryUsage( data )
src/node-performancemanager.js:409

Gets current server process load and adds it to a list collected over time also computes moving averages of 1 minute and a longer duration (5 minutes)

Parameters:
  • data <Object>
    • memory usage data
collectMetrics( )
src/node-performancemanager.js:496

Calls all metric collection functions to gather data

collectserverLoad( data )
src/node-performancemanager.js:314

Gets current Server process load and adds it to a list collected over time also computes moving averages of 1 minute and a longer duration (5 minutes)

Parameters:
  • data <Object>
    • processes load data list
collectServerTraffic( )
src/node-performancemanager.js:443

Gets current server traffic and adds it to a list collected over time also computes moving averages of 1 minute and a longer duration (5 minutes)

collectSystemTraffic( )
src/node-performancemanager.js:467

Gets current system traffic and adds it to a list collected over time also computes moving averages of 1 minute and a longer duration (5 minutes)

computeMessageSize( wsio, data, outBound )
src/node-performancemanager.js:938

Computes size of the data being transferred and received through Websockets

Parameters:
  • wsio <Object>
    • Websocket object that is responsible to client-server communication
  • data <Object>
    • Data being sent or received through sockets
  • outBound <Boolean>
    • Flag indicates whether data is outgoing or incoming
computeMovingAverages( metric, oneMinute, entireDuration )
src/node-performancemanager.js:365

Computes moving averages (1 minute and a longer duration)

Parameters:
  • metric <String>
    • metric for which averages are to be computed
  • oneMinute <Object>
    • placeholder object for one minute average
  • entireDuration <Object>
    • placeholder object for longer duration average
formatMemoryString( used, free, short )
src/node-performancemanager.js:745

Helper function to format memory usage info in a string

Parameters:
  • used <Number>
    • amount of memory used
  • free <Number>
    • amount of memory free
  • short <Boolean>
    • flag to request a short version of the string
getNiceNumber( number, giga )
src/node-performancemanager.js:721

Helper function to convert a number to shorter format with appropriate suffix determined (K for Kilo and so on)

Parameters:
getPercentString( val, remaining )
src/node-performancemanager.js:706

Helper function to get a percentage value

Parameters:
  • val <Number>
    • one part(of a total) for which percentage is to be computed
  • remaining <Number>
    • remaining part (of the total)
getTrafficData( )
src/node-performancemanager.js:1015

Retrieves the network traffic data and resets the place holder

printMetrics( )
src/node-performancemanager.js:799

Prints different performance metrics to the console

printServerHardware( )
src/node-performancemanager.js:769

Print a summary of the hardware that the server is running on

removeDisplayClient( idx )
src/node-performancemanager.js:146

Removes data of a closed display client.

Parameters:
  • idx <>

    The client ID

saveData( metric, data )
src/node-performancemanager.js:683

Saves metric data into current value placeholder and history list

Parameters:
  • metric <String>
    • metric for which data is being saved
  • data <Object>
    • current metric values obtained
setSamplingInterval( interval )
src/node-performancemanager.js:181

Sets sampling interval to 1, 2 or 5 seconds and restarts the sampling loop values 'often|slow|normal', every other value defaults to 'normal'

Parameters:
  • interval <String>
    • Interval specified as a user friendly string
updateClient( wsio )
src/node-performancemanager.js:158

Send a new monitoring client all the specifics

Parameters:
  • wsio <Object>

    client's websocket

wrapDataTransferFunctions( WebsocketIO )
src/node-performancemanager.js:864

Wraps the WebsocketIO emit and on functions to append size computation of the data

  • being transferred
Parameters:
  • WebsocketIO <Object>
    • Websocket object that is responsible to client-server communication