@@ -57,12 +57,38 @@ async function run() {
5757 // Stop the server
5858 withoutFirewallProc . kill ( ) ;
5959
60+ const withOpenTelemetryProc = spawn ( "node" , [ "app.js" ] , {
61+ env : {
62+ ...process . env ,
63+ PORT : 5003 ,
64+ NODE_OPTIONS :
65+ "--require @opentelemetry/auto-instrumentations-node/register" ,
66+ OTEL_TRACES_EXPORTER : "none" ,
67+ OTEL_METRICS_EXPORTER : "none" ,
68+ OTEL_LOGS_EXPORTER : "none" ,
69+ } ,
70+ stdio : "inherit" ,
71+ } ) ;
72+
73+ // Wait 2 seconds for the server to start and settle
74+ await setTimeout ( 2000 ) ;
75+
76+ const resultWithOpenTelemetry = await exec (
77+ generateWrkCommandForUrl ( "http://localhost:5003/empty" )
78+ ) ;
79+
80+ // Stop the server
81+ withOpenTelemetryProc . unref ( ) ;
82+ withOpenTelemetryProc . kill ( ) ;
83+
6084 const withFirewall = parseFloat ( resultWithFirewall . stdout . trim ( ) ) ;
6185 const withoutFirewall = parseFloat ( resultWithoutFirewall . stdout . trim ( ) ) ;
86+ const withOpenTelemetry = parseFloat ( resultWithOpenTelemetry . stdout . trim ( ) ) ;
6287
6388 console . log ( "--- Results ---" ) ;
6489 console . log ( `Without Zen: ${ withoutFirewall } Requests/sec` ) ;
6590 console . log ( `With Zen: ${ withFirewall } Requests/sec` ) ;
91+ console . log ( `With OpenTelemetry: ${ withOpenTelemetry } Requests/sec` ) ;
6692
6793 const increase = ( ( withoutFirewall - withFirewall ) / withoutFirewall ) * 100 ;
6894 console . log ( `Decrease with Zen for an empty route: ${ increase . toFixed ( 2 ) } %` ) ;
0 commit comments