function getSegmentName(metricName, typeDetails, route) {
  let segmentName = metricName
  if (typeDetails.path) {
    segmentName += route
  } else if (route.length > 1) {
    segmentName += '/' + route
  }

  return segmentName
}
Constructs segment name passed on path/route information

@private
@param {string} metricName metric name for middleware function
@param {object} typeDetails metadata about the middleware type
@param {string} route route path
@returns {string} name given to segment