public boolean stop() {
        if (this.shutdown.get()) {
            return true;
        }
        if (this.shutdown.compareAndSet(false, true)) {
            LOGGER.info("{} is closing ......", this.name);
            try {
                if (this.daemon != null) {
                    this.daemon.interrupt();
                    this.daemon.join();
                }
            } catch (Throwable e) {
                //
            }
            LOGGER.info("{} is stopped", this.name);
            return false;
        }
        return true;
    }
AbsStatsDaemon


Statistics daemon that periodically outputs metrics data to a file.
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/metrics/stats/AbsStatsDaemon.java