perfsonar-dev - perfsonar: r2835 - branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins
Subject: perfsonar development work
List archive
- From:
- To:
- Subject: perfsonar: r2835 - branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins
- Date: Thu, 13 Sep 2007 10:16:05 -0400
Author: nina
Date: 2007-09-13 10:16:04 -0400 (Thu, 13 Sep 2007)
New Revision: 2835
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSUtilizationDatum.java
Log:
support for valueunits="octets"
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSUtilizationDatum.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSUtilizationDatum.java
2007-09-13 12:33:45 UTC (rev 2834)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSUtilizationDatum.java
2007-09-13 14:16:04 UTC (rev 2835)
@@ -42,20 +42,23 @@
public class PSUtilizationDatum extends PSCountsDatum {
public static String units_bps = "bps";
public static String units_Bps = "Bps";
+ public static String units_Octets = "octets";
@Override
protected ArrayList<String> initSupportedTypes() {
ArrayList<String> a = new ArrayList<String>();
a.add(units_bps);
a.add(units_Bps);
+ a.add(units_Octets);
return a;
}
@Override
public void setValue(String value) throws UnsupportedTypeException {
try {
- if (units_Bps.equals(getType())) {
+ if (units_Bps.equals(getType()) ||
units_Octets.equals(getType().toLowerCase())) {
this.value = Double.parseDouble(value)*8;
NaN = Double.isNaN(this.value);
+
} else if (units_bps.equals(getType())) {
this.value = Double.parseDouble(value);
NaN = Double.isNaN(this.value);
@@ -73,6 +76,7 @@
@Override
public synchronized void setType(String type) throws
UnsupportedTypeException {
if ("".equals(type)) super.setType(units_Bps);
+ else if (units_Octets.equals(type.toLowerCase()))
super.setType(units_Bps);
else super.setType(type);
}
public long getBits() {
- perfsonar: r2835 - branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins, svnlog, 09/13/2007
Archive powered by MHonArc 2.6.16.