src/middlewares/metrics.js
function metricStart(ctx) {
	ctx.startTime = Date.now();
	ctx.startHrTime = process.hrtime();
	ctx.duration = 0;

	if (ctx.metrics) {
		const payload = generateMetricPayload(ctx);
		ctx.broker.emit("metrics.trace.span.start", payload);
	}
}
function metricStart(ctx) {
	ctx.startTime = Date.now();
	ctx.startHrTime = process.hrtime();
	ctx.duration = 0;

	if (ctx.metrics) {
		const payload = generateMetricPayload(ctx);
		ctx.broker.emit("metrics.trace.span.start", payload);
	}
}
function metricStart ( ctx ) { ctx . startTime = Date . now ( ) ; ctx . startHrTime = process . hrtime ( ) ; ctx . duration = 0 ; if ( ctx . metrics ) { const payload = generateMetricPayload ( ctx ) ; ctx . broker . emit ( "metrics.trace.span.start" , payload ) ; } }
Start metrics & send metric event.

@param {Context} ctx

@private
Start metrics & send metric event .