constructor({
    agentConfig,
    logger = defaultLogger,
    setInterval = global.setInterval
  } = {}) {
    const enabled = agentConfig?.agent_control?.enabled
    const checkInterval = parseInt(agentConfig?.agent_control?.health?.frequency, 10) * 1_000
    let outDir = agentConfig?.agent_control?.health?.delivery_location

    this.#logger = logger

    if (enabled !== true) {
      this.#logger.info('new relic agent control disabled, skipping health reporting')
      return
    }

    if (outDir.includes('://') === true) {
      outDir = fileURLToPath(outDir)
    }
    const dirCheck = directoryAvailable(outDir)
    if (dirCheck.available === false) {
      this.#logger.error('health check output directory not accessible, skipping health reporting', { error: dirCheck.error })
      return
    }

    this.#startTime = getTime()

    const uuid = crypto.randomUUID().replaceAll('-', '')
    this.#destFile = path.join(outDir, `health-${uuid}.yaml`)

    this.#logger.info(
      `new relic agent control is present, writing health on interval ${checkInterval} milliseconds to ${
        this.#destFile
      }`
    )
    this.#interval = setInterval(this.#healthCheck.bind(this), checkInterval)
    this.#interval.unref()

    this.#enabled = true
    this.#logger.info('health reporter initialized')
  }
Build a new health reporter instance.

Important: the shape of `agentConfig` will not be validated. It is expected
that this module is used in the context of the agent. Therefore, a
properly shaped configuration object should always be available and passed
in.

@param {object} [params] Construction parameters.
@param {object} params.agentConfig A standard `newrelic` configuration
object that has an `agent_control` property which is an instance of
{@link AgentControlConfig}.
@param {object} [params.logger] A standard logger instance.
@param {function} [params.setInterval] A function to use as `setInterval`.
Must return an interval object that supports the `unref()` method.