use of org.batfish.datamodel.collections.TreeMultiSet in project batfish by batfish.
the class Batfish method histogram.
private void histogram(Path testRigPath) {
Map<Path, String> configurationData = readConfigurationFiles(testRigPath, BfConsts.RELPATH_CONFIGURATIONS_DIR);
// todo: either remove histogram function or do something userful with
// answer
Map<String, VendorConfiguration> vendorConfigurations = parseVendorConfigurations(configurationData, new ParseVendorConfigurationAnswerElement(), ConfigurationFormat.UNKNOWN);
_logger.info("Building feature histogram...");
MultiSet<String> histogram = new TreeMultiSet<>();
for (VendorConfiguration vc : vendorConfigurations.values()) {
Set<String> unimplementedFeatures = vc.getUnimplementedFeatures();
histogram.add(unimplementedFeatures);
}
_logger.info("OK\n");
for (String feature : histogram.elements()) {
int count = histogram.count(feature);
_logger.outputf("%s: %s\n", feature, count);
}
}
Aggregations