stop(done) {
    if (this.#enabled === false) {
      done && done()
      return
    }

    clearInterval(this.#interval)

    const healthy = this.#status === HealthReporter.STATUS_HEALTHY
    let code = this.#status
    let msg = VALID_CODES.get(code)
    if (healthy === true) {
      // We only update the status on shutdown when the last known state is
      // the healthy state. Otherwise, we need to leave the current code in
      // place, and just update the report time.
      code = HealthReporter.STATUS_AGENT_SHUTDOWN
      msg = VALID_CODES.get(code)
    }

    writeStatus({
      file: this.#destFile,
      startTime: this.#startTime,
      healthy,
      code,
      msg,
      callback: (error) => {
        if (error) {
          this.#logger.error(
            `error when writing out health status during shutdown: ${error.message}`
          )
        }
        done && done()
      }
    })
  }
This should be invoked on agent shutdown after setting the status
to the shutdown status. It will stop the ongoing update interval,
initiate an immediate write of the status file, and then invoke the
provided callback.

@param {function} done Callback to be invoked after the status file has
been updated.