May 2018
Intermediate to advanced
404 pages
11h 51m
English
This metric is very useful in order to see things such as how many times an event has occurred. In this exercise, we will see the number of times that our /hello-world is invoked. You can follow along with the example in Chapter 9/counter-metric:
import { ExpressMiddlewareInterface } from "routing-controllers"; const pmx=require('pmx').init({http:true,errors:true, custom_probes:true,network:true,ports:true}); const pmxProbe=pmx.probe(); const pmxCounter=pmxProbe.counter({ name:'request counter for Hello World Controller', agg_type:'sum'}) export class CounterMiddleWare implements ExpressMiddlewareInterface ...
Read now
Unlock full access