public static byte[] toBytes(AutoBalancerMetrics metric) {
        ByteBuffer byteBuffer = metric.toBuffer(HEADER_LENGTH);
        byteBuffer.put(METRIC_TYPE_OFFSET, metric.metricType());
        return byteBuffer.array();
    }
Serialize the Auto Balancer metric to a byte array.

@param metric Metric to be serialized.
@return Serialized Auto Balancer metric as a byte array.
core/src/main/java/kafka/autobalancer/metricsreporter/metric/MetricSerde.java