import { api } from './client'
import { createCachedGetter } from './cache'

const browserPoolStatsGetter = createCachedGetter(async () => {
  const { data } = await api.get('/browser_pool/stats')
  return data
}, 4_000)

export async function fetchBrowserPoolStats(options = {}) {
  return browserPoolStatsGetter.run(options)
}
