@@ -42,6 +42,7 @@ describe('config', () => {
4242 expect ( config . logger ) . to . be . an . instanceof ( ConsoleLogger )
4343 expect ( config . exporters [ 0 ] ) . to . be . an . instanceof ( AgentExporter )
4444 expect ( config . profilers [ 0 ] ) . to . be . an . instanceof ( WallProfiler )
45+ expect ( config . profilers [ 0 ] . codeHotspotsEnabled ( ) ) . false
4546 expect ( config . profilers [ 1 ] ) . to . be . an . instanceof ( SpaceProfiler )
4647 } )
4748
@@ -57,8 +58,9 @@ describe('config', () => {
5758 error ( ) { }
5859 } ,
5960 exporters : 'agent,file' ,
60- profilers : 'wall' ,
61- url : 'http://localhost:1234/'
61+ profilers : 'space,wall' ,
62+ url : 'http://localhost:1234/' ,
63+ codeHotspotsEnabled : true
6264 }
6365
6466 const config = new Config ( options )
@@ -78,8 +80,10 @@ describe('config', () => {
7880 expect ( config . exporters [ 0 ] . _url . toString ( ) ) . to . equal ( options . url )
7981 expect ( config . exporters [ 1 ] ) . to . be . an . instanceof ( FileExporter )
8082 expect ( config . profilers ) . to . be . an ( 'array' )
81- expect ( config . profilers . length ) . to . equal ( 1 )
82- expect ( config . profilers [ 0 ] ) . to . be . an . instanceOf ( WallProfiler )
83+ expect ( config . profilers . length ) . to . equal ( 2 )
84+ expect ( config . profilers [ 0 ] ) . to . be . an . instanceOf ( SpaceProfiler )
85+ expect ( config . profilers [ 1 ] ) . to . be . an . instanceOf ( WallProfiler )
86+ expect ( config . profilers [ 1 ] . codeHotspotsEnabled ( ) ) . true
8387 } )
8488
8589 it ( 'should filter out invalid profilers' , ( ) => {
@@ -127,7 +131,8 @@ describe('config', () => {
127131
128132 it ( 'should support profiler config with DD_PROFILING_PROFILERS' , ( ) => {
129133 process . env = {
130- DD_PROFILING_PROFILERS : 'wall'
134+ DD_PROFILING_PROFILERS : 'wall' ,
135+ DD_PROFILING_EXPERIMENTAL_CODEHOTSPOTS_ENABLED : '1'
131136 }
132137 const options = {
133138 logger : {
@@ -143,6 +148,7 @@ describe('config', () => {
143148 expect ( config . profilers ) . to . be . an ( 'array' )
144149 expect ( config . profilers . length ) . to . equal ( 1 )
145150 expect ( config . profilers [ 0 ] ) . to . be . an . instanceOf ( WallProfiler )
151+ expect ( config . profilers [ 0 ] . codeHotspotsEnabled ( ) ) . true
146152 } )
147153
148154 it ( 'should support profiler config with DD_PROFILING_XXX_ENABLED' , ( ) => {
@@ -190,7 +196,8 @@ describe('config', () => {
190196
191197 it ( 'should prioritize options over env variables' , ( ) => {
192198 process . env = {
193- DD_PROFILING_PROFILERS : 'wall'
199+ DD_PROFILING_PROFILERS : 'space' ,
200+ DD_PROFILING_EXPERIMENTAL_CODEHOTSPOTS_ENABLED : '1'
194201 }
195202 const options = {
196203 logger : {
@@ -199,14 +206,16 @@ describe('config', () => {
199206 warn ( ) { } ,
200207 error ( ) { }
201208 } ,
202- profilers : [ 'space' ]
209+ profilers : [ 'wall' ] ,
210+ codeHotspotsEnabled : false
203211 }
204212
205213 const config = new Config ( options )
206214
207215 expect ( config . profilers ) . to . be . an ( 'array' )
208216 expect ( config . profilers . length ) . to . equal ( 1 )
209- expect ( config . profilers [ 0 ] ) . to . be . an . instanceOf ( SpaceProfiler )
217+ expect ( config . profilers [ 0 ] ) . to . be . an . instanceOf ( WallProfiler )
218+ expect ( config . profilers [ 0 ] . codeHotspotsEnabled ( ) ) . false
210219 } )
211220
212221 it ( 'should support tags' , ( ) => {
0 commit comments