nl_tokens: Monitor CPU and memory for this instance .
pl_tokens: function ( options ) { // Validate options assert ( options , "Options are required" ) ; assert ( options . drain , "A drain for the measurements must be provided!" ) ; assert ( options . component , "A component must be specified" ) ; assert ( options . process , "A process name must be specified" ) ; // Provide default options options = _ . defaults ( { } , options , { interval : 60 } ) ; // Clear reporting if already started if ( _processUsageReportingInterval ) { debug ( "WARNING: startProcessUsageReporting() already started!" ) ; clearInterval ( _processUsageReportingInterval ) ; _processUsageReportingInterval = null ; } // Lazy load the usage monitor module var <mask> = require ( 'usage' ) ; // Create reporter var reporter = series . UsageReports . reporter ( options . drain ) ; // Set interval to report usage at interval _processUsageReportingInterval = setInterval ( function ( ) { // Lookup usage for the current process usage . lookup ( process . pid , { keepHistory : true } , function ( err , result ) { // Check for error if ( err ) { debug ( "Failed to get usage statistics, err: %s, %j" , err , err , err . stack ) ; return ; } // Report usage reporter ( { component : options . component , process : options . process , cpu : result . cpu , memory : result . memory } ) ; } ) ; } , options . interval * 1000 ) ; }