public static GenericApplicationModel toGenericApplicationModel(Map<Node, List<MetricsPacket>> metricsByNode) {
        var applicationModel = new GenericApplicationModel();

        var genericJsonModels = new ArrayList<GenericJsonModel>();
        metricsByNode.forEach(
                (node, metrics) -> genericJsonModels.add(toGenericJsonModel(metrics, node)));

        applicationModel.nodes = genericJsonModels;
        return applicationModel;
    }
Utilities for converting between metrics packets and the generic json format.

@author gjoranv
metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/json/GenericJsonUtil.java