@@ -13,18 +13,34 @@ function startIndicators() {
1313 const express = require ( 'express' ) ;
1414
1515 const app = express ( ) ;
16- const failingEndpoint = require ( './indicator/FailingEndpoint' ) ;
17- app . use ( '/' , failingEndpoint ) ;
16+ app . use ( '/' , require ( './indicator/FailingEndpoint' ) ) ;
17+ app . use ( '/' , require ( './indicator/HighLoadEndpoint' ) ) ;
18+ app . use ( '/' , require ( './indicator/SlowEndpoint' ) ) ;
19+
1820 app . listen ( 3000 ) ;
1921}
2022
2123startIndicators ( ) ;
2224
2325function executeIndicators ( ) {
2426 const axios = require ( 'axios' ) ;
27+
28+ //failing endpoint indicator
2529 axios . get ( 'http://localhost:3000/indicator/fail-100-percent' ) . catch ( ( ) => { } ) ;
2630 axios . get ( 'http://localhost:3000/indicator/fail-75-percent' ) . catch ( ( ) => { } ) ;
2731 axios . get ( 'http://localhost:3000/indicator/fail-50-percent' ) . catch ( ( ) => { } ) ;
32+
33+ //slow endpoint indicator
34+ axios . get ( 'http://localhost:3000/indicator/slow-2000ms' ) . catch ( ( ) => { } ) ;
35+ axios . get ( 'http://localhost:3000/indicator/slow-1000ms' ) . catch ( ( ) => { } ) ;
36+
37+ //high load endpoint indicator
38+ axios . get ( 'http://localhost:3000/indicator/high-load-four-per-second' ) . catch ( ( ) => { } ) ;
39+ axios . get ( 'http://localhost:3000/indicator/high-load-four-per-second' ) . catch ( ( ) => { } ) ;
40+ axios . get ( 'http://localhost:3000/indicator/high-load-four-per-second' ) . catch ( ( ) => { } ) ;
41+ axios . get ( 'http://localhost:3000/indicator/high-load-four-per-second' ) . catch ( ( ) => { } ) ;
42+ axios . get ( 'http://localhost:3000/indicator/high-load-two-per-second' ) . catch ( ( ) => { } ) ;
43+ axios . get ( 'http://localhost:3000/indicator/high-load-two-per-second' ) . catch ( ( ) => { } ) ;
2844}
2945
3046setInterval ( executeIndicators , 1000 ) ;
0 commit comments