@Override
    public void update(long newValue) {
        while (true) {
            long cur = this.value.get();
            if (newValue <= cur) {
                break;
            }
            if (this.value.compareAndSet(cur, newValue)) {
                break;
            }
        }
    }
LongMaxGauge, store max value information.

The metric includes a atomic long value, to store the current max value.
inlong-tubemq/tubemq-core/src/main/java/org/apache/inlong/tubemq/corebase/metric/impl/LongMaxGauge.java