public String buildKVString() {
        StringBuilder builder = new StringBuilder();
        metricValueMap.forEach((k, v) -> builder.append(k).append(":").append(v).append(","));
        if (builder.length() == 0) {
            return "";
        }
        return builder.substring(0, builder.length() - 1);
    }
Serialize the metric to a byte buffer with the header size reserved.

@param headerSize the header size to reserve.
@return A ByteBuffer with header size reserved at the beginning.
core/src/main/java/kafka/autobalancer/metricsreporter/metric/AutoBalancerMetrics.java