perfsonar-dev - perfsonar: r5110 - branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl
Subject: perfsonar development work
List archive
- From:
- To:
- Subject: perfsonar: r5110 - branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl
- Date: Tue, 28 Apr 2009 09:32:22 -0400
Author: roland.karch
Date: 2009-04-28 09:32:21 -0400 (Tue, 28 Apr 2009)
New Revision: 5110
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTLRequest.java
Log:
updated for schema changes with latest version of oppd (3.1.1)
handles missing input of test duration gracefully - assume bwctl default 10s
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTLRequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTLRequest.java
2009-04-27 09:51:31 UTC (rev 5109)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl/BWCTLRequest.java
2009-04-28 13:32:21 UTC (rev 5110)
@@ -239,7 +239,17 @@
mainComponent.clearGraph();
String startTime = "";
String endTime = mainComponent.duration.getText();
- double duration =
Double.parseDouble(mainComponent.duration.getText());
+ if (endTime.equals("")) {
+ // BWCTL default
+ endTime = "10";
+ }
+ double duration;
+ try {
+ duration = Double.parseDouble(endTime);
+ } catch (NumberFormatException e) {
+ mainComponent.infoLabelLine1.setText("Test duration
cannot be converted from string to number");
+ duration = 10.0;
+ }
datas = response.getElementsByTagName("nmwg:data");
@@ -250,7 +260,7 @@
for (j = 0; j < datums.getLength(); j++)
{
datum = (Element) datums.item(j);
- String interval =
datum.getAttribute("duration");
+ String interval =
datum.getAttribute("interval");
String time = interval.split("-")[1];
if(startTime.equals("")) startTime = time;
String value = datum.getAttribute("value");
@@ -265,7 +275,7 @@
// " " +
// datum.getAttribute("valueUnits") +
// "\n";
- output = output + "Interval:
"+datum.getAttribute("duration")+" Transferred: ";
+ output = output + "Interval:
"+datum.getAttribute("interval")+" Transferred: ";
String units1 =
datum.getAttribute("numBytesUnits");
String value1 =
datum.getAttribute("numBytes");
Long transferred = Long.parseLong(value1);
- perfsonar: r5110 - branches/perfsonarui/src/org/perfsonar/perfsonarui/bwctl, svnlog, 04/28/2009
Archive powered by MHonArc 2.6.16.