private static AutoBalancerMetrics bytesInToMetric(String topic, int partition, long nowMs,
                                                       int brokerId, String brokerRack, double value) {

        if (topic != null && partition != -1) {
            return new TopicPartitionMetrics(nowMs, brokerId, brokerRack, topic, partition).put(RawMetricTypes.PARTITION_BYTES_IN, value);
        }
        return null;
    }
Check if tags are valid for a topic-partition metric

@param tags metric tags
@return true if valid, false otherwise
core/src/main/java/kafka/autobalancer/metricsreporter/metric/MetricsUtils.java