private void updateInterface(Interface inter, MetricReport report, int minute) {
String domain = inter.getDomain();
String key = inter.getKey();
try {
MetricItem inItem = report.findOrCreateMetricItem(domain + ":Metric:" + key + "-flow-in");
MetricItem outItem = report.findOrCreateMetricItem(domain + ":Metric:" + key + "-flow-out");
MetricItem inDiscardsItem = report.findOrCreateMetricItem(domain + ":Metric:" + key
+ "-discard/error-indiscards");
MetricItem outDiscardsItem = report.findOrCreateMetricItem(domain + ":Metric:" + key
+ "-discard/error-outdiscards");
MetricItem inErrorsItem = report.findOrCreateMetricItem(domain + ":Metric:" + key + "-discard/error-inerrors");
MetricItem outErrorsItem = report.findOrCreateMetricItem(domain + ":Metric:" + key
+ "-discard/error-outerrors");
inter.setIn(inItem.findOrCreateSegment(minute).getSum() / 60 * 8);
inter.setOut(outItem.findOrCreateSegment(minute).getSum() / 60 * 8);
inter.setInDiscards(inDiscardsItem.findOrCreateSegment(minute).getSum() / 60);
inter.setOutDiscards(outDiscardsItem.findOrCreateSegment(minute).getSum() / 60);
inter.setInErrors(inErrorsItem.findOrCreateSegment(minute).getSum() / 60);
inter.setOutErrors(outErrorsItem.findOrCreateSegment(minute).getSum() / 60);
} catch (Exception e) {
Cat.logError(e);
}
}