File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -241,9 +241,7 @@ module.exports.monitor = function() {
241241 return this . api ;
242242} ;
243243
244- module . exports . lrtime = function ( ) {
245- return agent . lrtime ( ) ;
246- } ;
244+ module . exports . lrtime = agent . lrtime ;
247245
248246module . exports . configure = function ( options ) {
249247 options = options || { } ;
@@ -262,4 +260,4 @@ module.exports.setJSONProfilingMode = function(val) {
262260
263261module . exports . getJSONProfilingMode = function ( ) {
264262 return jsonProfilingMode ;
265- }
263+ }
Original file line number Diff line number Diff line change @@ -19,11 +19,22 @@ var monitor = app.appmetrics.monitor();
1919app . appmetrics . enable ( "profiling" ) ;
2020
2121var tap = require ( 'tap' ) ;
22- tap . plan ( 5 ) ; // NOTE: This needs to be updated when tests are added/removed
22+ tap . plan ( 6 ) ; // NOTE: This needs to be updated when tests are added/removed
2323tap . tearDown ( function ( ) {
2424 app . endRun ( ) ;
2525} ) ;
2626
27+ tap . test ( 'lrtime is a function or undefined' , function ( t ) {
28+ var lrtime = app . appmetrics . lrtime ;
29+
30+ if ( lrtime ) {
31+ t . doesNotThrow ( lrtime , 'callable, not just present' ) ;
32+ } else {
33+ t . notEqual ( process . platform , 'linux' , 'lrtime mandatory on linux' ) ;
34+ }
35+ t . end ( ) ;
36+ } ) ;
37+
2738var completedTests = { } ; //Stores which tests have been run, ensures single run per test
2839
2940monitor . on ( 'cpu' , function ( data ) {
@@ -394,4 +405,4 @@ function runEventLoopTests(elData, t){
394405 t . ok ( elData . latency [ elem ] <= 5000 ,
395406 "Contains " + elem + " latency value less that 5 seconds" ) ;
396407 }
397- }
408+ }
You can’t perform that action at this time.
0 commit comments