use of org.ovirt.engine.ui.common.widget.renderer.RxTxTotalRenderer in project ovirt-engine by oVirt.
the class VmInterfaceListGroupItem method createStatisticsItemContainerPanel.
private Container createStatisticsItemContainerPanel(VmNetworkInterface networkInterface) {
Row content = new Row();
Column column = new Column(ColumnSize.MD_12);
content.add(column);
RxTxRateRenderer rateRenderer = new RxTxRateRenderer();
RxTxTotalRenderer totalRenderer = new RxTxTotalRenderer();
DListElement dl = Document.get().createDLElement();
dl.addClassName(DL_HORIZONTAL);
addDetailItem(templates.sub(constants.rxRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { networkInterface.getStatistics().getReceiveRate(), networkInterface.hasSpeed() ? networkInterface.getSpeed().doubleValue() : 0 })), dl);
addDetailItem(templates.sub(constants.txRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { networkInterface.getStatistics().getTransmitRate(), networkInterface.hasSpeed() ? networkInterface.getSpeed().doubleValue() : 0 })), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.rxTotal()), SafeHtmlUtils.fromString(totalRenderer.render(networkInterface.getStatistics().getReceivedBytes())), dl);
addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.txTotal()), SafeHtmlUtils.fromString(totalRenderer.render(networkInterface.getStatistics().getTransmittedBytes())), dl);
addDetailItem(templates.sub(constants.dropsInterface(), constants.pkts()), SafeHtmlUtils.fromString(String.valueOf(networkInterface.getStatistics().getReceiveDropRate() + networkInterface.getStatistics().getTransmitDropRate())), dl);
column.getElement().appendChild(dl);
return createItemContainerPanel(content);
}
Aggregations