<commit_before>const metrics = require('./metrics')

function middleware (request, response, done) {
  var start = process.hrtime()

  response.on('finish', function () {
    metrics.observe(request.method, request.path, response.statusCode, start)
  })

  return done()
};

function instrument (server, options) {
  server.use(middleware)
  server.get(options.url, (req, res) => {
    res.header('content-type', 'text/plain')
    return res.send(metrics.summary())
  })
}

function instrumentable (server) {
  return server && server.defaultConfiguration && server.use
}<commit_msg>Revert express check for simpler PR<commit_after>const metrics = require('./metrics')

function middleware (request, response, done) {
  var start = process.hrtime()

  response.on('finish', function () {
    metrics.observe(request.method, request.path, response.statusCode, start)
  })

  return done()
};

function instrument (server, options) {
  server.use(middleware)
  server.get(options.url, (req, res) => {
    res.header('content-type', 'text/plain')
    return res.send(metrics.summary())
  })
}

function instrumentable (server) {
  return server && !server.name && server.use
}
{'fraction_non_alphanumeric': 0.15089514066496162, 'fraction_numerical': 0.0, 'mean_word_length': 4.485981308411215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3656916', 'n_tokens_mistral': 356, 'n_tokens_neox': 352, 'n_words': 81}