testServer :: Bool -> (Application -> IO a) -> Int -> IO WaiMetrics
testServer measure action times = do
  store <- newStore
  waiMetrics <- registerWaiMetrics store
  app <- scottyApp $ do
    when (measure) (middleware (metrics waiMetrics))
    get "/" $ html "Ping"
  replicateM_ times (action app)
  return waiMetrics
testServer :: Bool -> (Application -> IO a) -> Int -> IO WaiMetrics
testServer measure action times = do
  store <- newStore
  waiMetrics <- registerWaiMetrics store
  app <- scottyApp $ do
    when (measure) (middleware (metrics waiMetrics))
    get "/" $ html "Ping"
  replicateM_ times (action app)
  return waiMetrics
testServer measure action times = do
  store <- newStore
  waiMetrics <- registerWaiMetrics store
  app <- scottyApp $ do
    when (measure) (middleware (metrics waiMetrics))
    get "/" $ html "Ping"
  replicateM_ times (action app)
  return waiMetrics