@@ -2,51 +2,11 @@ const SourcePlusPlus = require("sourceplusplus");
22SourcePlusPlus . start ( ) ;
33
44const addBreakpoint = require ( "./command/add-breakpoint" ) ;
5+ const executeIndicators = require ( "./indicator/indicator" ) ;
56
67function executeDemos ( ) {
78 addBreakpoint ( ) ;
89 executeIndicators ( ) ;
910}
1011
1112setInterval ( executeDemos , 1000 ) ;
12- 13- function startIndicators ( ) {
14- const express = require ( 'express' ) ;
15- const app = express ( ) ;
16- 17- const failingEndpoint = require ( './indicator/failing-endpoint' ) ;
18- app . use ( '/' , failingEndpoint ) ;
19- 20- const highLoadEndpoint = require ( './indicator/high-load-endpoint' ) ;
21- app . use ( '/' , highLoadEndpoint ) ;
22- 23- const slowEndpoint = require ( './indicator/slow-endpoint' ) ;
24- app . use ( '/' , slowEndpoint ) ;
25- 26- const unusedEndpoint = require ( './indicator/unused-endpoint' ) ;
27- app . use ( '/' , unusedEndpoint ) ;
28- 29- app . listen ( 3000 ) ;
30- }
31- 32- startIndicators ( ) ;
33- 34- function executeIndicators ( ) {
35- const axios = require ( 'axios' ) ;
36- 37- //failing endpoint indicator
38- axios . get ( 'http://localhost:3000/indicator/fail-100-percent' ) . catch ( ( ) => { } ) ;
39- axios . get ( 'http://localhost:3000/indicator/fail-50-percent' ) . catch ( ( ) => { } ) ;
40- 41- //slow endpoint indicator
42- axios . get ( 'http://localhost:3000/indicator/slow-2000ms' ) . catch ( ( ) => { } ) ;
43- axios . get ( 'http://localhost:3000/indicator/slow-1000ms' ) . catch ( ( ) => { } ) ;
44- 45- //high load endpoint indicator
46- axios . get ( 'http://localhost:3000/indicator/high-load-four-per-second' ) . catch ( ( ) => { } ) ;
47- axios . get ( 'http://localhost:3000/indicator/high-load-four-per-second' ) . catch ( ( ) => { } ) ;
48- axios . get ( 'http://localhost:3000/indicator/high-load-four-per-second' ) . catch ( ( ) => { } ) ;
49- axios . get ( 'http://localhost:3000/indicator/high-load-four-per-second' ) . catch ( ( ) => { } ) ;
50- axios . get ( 'http://localhost:3000/indicator/high-load-two-per-second' ) . catch ( ( ) => { } ) ;
51- axios . get ( 'http://localhost:3000/indicator/high-load-two-per-second' ) . catch ( ( ) => { } ) ;
52- }
0 commit comments