public static void main(String[] args) {

        if (args.length != 1) {
            throw new IllegalArgumentException("Expected exactly one argument: directory to write to");
        }
        var path = args[0];

        var metrics = getMetrics();
        metrics.forEach((metricType, metricArray) -> writeMetricDocumentation(path, metricArray, metricType));

        var metricSets = getMetricSets();
        metricSets.forEach((name, metricSet) -> writeMetricSetDocumentation(path, name, metricSet, metrics));

        UnitDocumentation.writeUnitDocumentation(path, Unit.values());
    }
@author olaa

Helper class to generate metric reference documentation for docs.vespa.ai
metrics/src/main/java/ai/vespa/metrics/docs/DocumentationGenerator.java