function constructRecorder({ txInfo, typeDetails, shim, metricName }) {
  let recorder = null
  if (typeDetails.record) {
    const stackPath = txInfo.transaction.nameState.getPath() || ''
    recorder = makeMiddlewareRecorder(shim, metricName + '/' + stackPath)
  }
  return recorder
}
Creates the middleware recorder if the type specifies this flag

@private
@param {object} params object passed to fn
@param {object} params.txInfo transaction
@param {object} params.typeDetails metadata about the middleware type
@param {Shim} params.shim instance of shim
@param {string} params.metricName metric name for middleware function
@returns {Function} recorder for middleware type