Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2705 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels plugins ui/panels

Subject: perfsonar development work

List archive

perfsonar: r2705 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels plugins ui/panels


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2705 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels plugins ui/panels
  • Date: Wed, 22 Aug 2007 16:09:31 -0400

Author: nina
Date: 2007-08-22 16:09:31 -0400 (Wed, 22 Aug 2007)
New Revision: 2705

Added:

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetricsOptionPanel.java
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAPerfsonarModel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Discards.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Errors.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserDataComparator.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MAResponseChartPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataTableModel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSCountsDatum.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSDiscardsDatum.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSErrorsDatum.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSTime.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSTypedValue.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSUtilizationDatum.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
Log:
initial visualization of input errors / output drops

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAPerfsonarModel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAPerfsonarModel.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAPerfsonarModel.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -44,6 +44,7 @@
import org.perfsonar.perfsonarui.ma.ui.actions.SetupDataRetrieveAllAction;
import org.perfsonar.perfsonarui.ma.ui.actions.TracerouteAction;
import org.perfsonar.perfsonarui.ma.ui.panels.MainPanelMA;
+import org.perfsonar.perfsonarui.ma.ui.panels.MetricsOptionPanel;
import org.perfsonar.perfsonarui.ma.ui.panels.RequestOptionsPanel;
import org.perfsonar.perfsonarui.plugins.IPerfsonarRequest;
import org.perfsonar.perfsonarui.plugins.IPerfsonarTab;
@@ -60,6 +61,7 @@
import org.perfsonar.perfsonarui.ui.actions.PerfsonarRequestAction;
import org.perfsonar.perfsonarui.ui.actions.SetupDataRequestAction;
import org.perfsonar.perfsonarui.ui.panels.InterfaceUtilizationSeries;
+import org.perfsonar.perfsonarui.ui.panels.PerfsonarTimeSeries;
import org.perfsonar.perfsonarui.ui.panels.PerfsonarTimeSeriesDataset;
import org.perfsonar.perfsonarui.ui.panels.ResponseDetailsPane;
import org.perfsonar.perfsonarui.ui.panels.TimeOptionsPanel;
@@ -90,12 +92,11 @@
public static Color[] outSeriesColor = {new Color(64,64,255,120),new
Color(0,42,151,200)};
public static Pattern ip4Pattern =
Pattern.compile("^((\\b((25[0-5])|(2[0-4]\\d)|([0-1]?[0-9]{0,2}))\\b)\\.){3}(\\b((25[0-5])|(2[0-4]\\d)|([0-1]?[0-9]{0,2}))\\b)$");
public static Pattern ip6Pattern =
Pattern.compile("^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\\b((25[0-5])|(2[0-4]\\d)|([0-1]?[0-9]{0,2}))\\b)\\.){3}(\\b((25[0-5])|(2[0-4]\\d)|([0-1]?[0-9]{0,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\\b((25[0-5])|(2[0-4]\\d)|([0-1]?[0-9]{0,2}))\\b)\\.){3}(\\b((25[0-5])|(2[0-4]\\d)|([0-1]?[0-9]{0,2}))\\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\\b((25[0-5])|(2[0-4]\\d)|([0-1]?[0-9]{0,2}))\\b)\\.){3}(\\b((25[0-5])|(2[0-4]\\d)|([0-1]?[0-9]{0,2}))\\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$");
-
-
- //protected PSUIAction[] statsTimeActions;
protected String tracerouteURL="https://noc-mon.srce.hr/visual_perf/";;
protected TracerouteShell tracerouteShell;
protected TracerouteAction traceAction;
+
+ protected String currentEventType =
"http://ggf.org/ns/nmwg/characteristic/utilization/2.0";;

public TracerouteAction getTraceAction() {
return traceAction;
@@ -173,10 +174,19 @@
IPerfsonarSchema schema =
endpoint.getSchema();
if (schema.equals("NMWG2v2")) return new
MARequest_NMWG2();
else if (schema.equals("NMWG2v2_netutil"))
return new MARequest_NMWG2_Netutil();
- else if
(schema.equals(MARequestPerfsonar2_0.schemaID)) return new
MARequestPerfsonar2_0();
- else if (schema.equals("perfsonar")) return
new MARequest();
- else if
(schema.equals(IPPMRequest.requestType)) return new IPPMRequest();
- else return null;
+ else if (schema.equals("perfsonar")) return new MARequest();
+ else if (schema.equals(IPPMRequest.requestType)) return new
IPPMRequest();
+ else if
(schema.equals(MARequestPerfsonar2_0.schemaID)) {
+ endpoint.setEvent(getCurrentEventType(), 0);
+ endpoint.setEvent(getCurrentEventType(), 1);
+ if
("http://ggf.org/ns/nmwg/characteristic/utilization/2.0".equals(getCurrentEventType()))
+ return new MARequestPerfsonar2_0();
+ if
("http://ggf.org/ns/nmwg/characteristic/discards/2.0".equals(getCurrentEventType()))
+ return new MARequest_Discards();
+ if
("http://ggf.org/ns/nmwg/characteristic/errors/2.0".equals(getCurrentEventType()))
+ return new MARequest_Errors();
+ }
+ return null;
}
};
}
@@ -188,6 +198,8 @@
PerfsonarTimeSeriesDataset ifDataset = new
PerfsonarTimeSeriesDataset();
ifDataset.addSeries("inbound",new
InterfaceUtilizationSeries("inbound",true));
ifDataset.addSeries("outbound",new
InterfaceUtilizationSeries("outbound",false));
+ ifDataset.addSeries("Eps",new PerfsonarTimeSeries("Input errors"));
+ ifDataset.addSeries("Dps",new PerfsonarTimeSeries("Output drops"));
return ifDataset;
}
public List<IPerfsonarSchema> getSupportedRequests() {
@@ -318,7 +330,7 @@
tp.addTimeAction((ITimeSetAction)metadataRequestAction);


- return new JComponent[]{tp,new RequestOptionsPanel(this)};
+ return new JComponent[]{tp,new RequestOptionsPanel(this),new
MetricsOptionPanel(this)};
}
@Override
public JComponent[] createDetailsComponent(Component parentComponent)
{
@@ -359,4 +371,10 @@
public int getOrder() {
return 10;
}
+ public synchronized String getCurrentEventType() {
+ return currentEventType;
+ }
+ public synchronized void setCurrentEventType(String currentEventType) {
+ this.currentEventType = currentEventType;
+ }
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequestPerfsonar2_0.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -32,6 +32,7 @@
public class MARequestPerfsonar2_0 extends MARequest_NMWG2_Netutil {
public static String schemaID = "http://schemas.perfsonar.net/2.0";;
protected static String URI_nmwgr =
"http://ggf.org/ns/nmwg/result/2.0/";;
+

protected Namespace nmwgr = null;


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Discards.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Discards.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Discards.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -29,6 +29,9 @@

package org.perfsonar.perfsonarui.ma;

+import org.perfsonar.perfsonarui.plugins.PSCountsDatum;
+import org.perfsonar.perfsonarui.plugins.PSDiscardsDatum;
+
public class MARequest_Discards extends MARequest_Errors {

public MARequest_Discards() {
@@ -46,4 +49,8 @@
protected String getSupportedEventType() {
return "http://ggf.org/ns/nmwg/characteristic/discards/2.0";;
}
+ protected PSCountsDatum createCountsDatum() {
+ return new PSDiscardsDatum();
+
+ }
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Errors.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Errors.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MARequest_Errors.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -100,24 +100,24 @@
}

protected void processData(Node data, UserData userData,
ITimeValueResponse timeValueResponse) {
- //System.out.println("Process data " +
((Element)data).getAttribute("id"));
- //String dataId = userData.getId();
+ PSCountsDatum d = createCountsDatum();
+ PSTime t = new PSTime();
+
String dataId = ((org.w3c.dom.Element)data).getAttribute("id");
- timeValueResponse.clear(userData.getType());
+ //timeValueResponse.clear(userData.getType());
+ timeValueResponse.clear(d.getDefaultType());
timeValueResponse.setUserData(userData);
timeValueResponse.initializeResponse();
NodeList datum =
((org.w3c.dom.Element)data).getElementsByTagNameNS(URI_perfsonar[perfsonar_version][1],"datum");

- PSCountsDatum d = createCountsDatum();
- PSTime t = new PSTime();
-
for (int i=0; i < datum.getLength();i++) {
Node n = datum.item(i);

if ((n != null) && (n instanceof Element)) {
try {
processDatum((org.w3c.dom.Element)n, d,t);
-
timeValueResponse.setDatum(dataId,userData.getType(),t,d);
+
//timeValueResponse.setDatum(dataId,userData.getType(),t,d);
+ timeValueResponse.setDatum(dataId,d.getType(),t,d);
} catch (UnsupportedTypeException x) {
logger.error(x);
}

Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
2007-08-22 13:47:21 UTC (rev 2704)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -60,7 +60,7 @@
protected double[] ifmbits = new double[2];

protected static int DATA_COLUMNS=3;
- protected static int DATA_ROWS=16;
+ protected static int DATA_ROWS=18;

//public static int ID_NAME=0;
public static final int DIRECTION_INPUT=0;
@@ -84,6 +84,8 @@
public static final int INDEX_CONSOLIDATION = 14;
public static final int INDEX_RESOLUTION = 15;
public static final int INDEX_DOMAIN = 16;
+ public static final int INDEX_INERRORS = 17;
+ public static final int INDEX_OUTDISCARDS = 18;

public static String[] titles = {
"IP version",
@@ -101,7 +103,10 @@
"event type",
"class of service",
"Consolidation function",
- AbstractUserData.RESOLUTION
+ AbstractUserData.RESOLUTION,
+ "Domain",
+ "Input errors",
+ "Output drops"
};
public static String[] names = {
"IP version",
@@ -119,7 +124,10 @@
"event type",
"class of service",
"Consolidation function",
- "Resolution"
+ "Resolution",
+ "Domain",
+ "Eps",
+ "Dps"
};

static final double M1 = 1.0/(1024.0*1024.0);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserDataComparator.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserDataComparator.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserDataComparator.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -89,6 +89,15 @@
r = ((UserData)
o1).getEndpoint().getTitle().compareTo(((UserData)
o2).getEndpoint().getTitle());
break;
}
+ case UserData.INDEX_INERRORS : {
+ r = compareNumericFields((UserData) o1,(UserData)
o2,UserData.INDEX_INERRORS);
+ break;
+ }
+ case UserData.INDEX_OUTDISCARDS : {
+ r = compareNumericFields((UserData) o1,(UserData)
o2,UserData.INDEX_OUTDISCARDS);
+ break;
+ }
+
default: {
r = ((UserData)
o1).getResponse(mode).compareTo(((UserData) o2).getResponse(mode));
break;

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MAResponseChartPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MAResponseChartPanel.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MAResponseChartPanel.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -20,6 +20,7 @@
package org.perfsonar.perfsonarui.ma.ui.panels;

import java.awt.BorderLayout;
+import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.LayoutManager;
@@ -115,6 +116,21 @@
bitAxis.setTickMarkPaint(gridColor);
bitAxis.setTickMarksVisible(true);

+ NumberAxis countAxis = new NumberAxis("Input Errors / Output Drops")
{
+ /**
+ *
+ */
+ private static final long serialVersionUID = -8247407792580685L;
+
+ @Override
+ public void autoAdjustRange() {
+ super.autoAdjustRange();
+ }
+ };
+ countAxis.setAutoRange(true);
+ countAxis.setAxisLinePaint(Color.red);
+ countAxis.setTickMarkPaint(gridColor);
+ countAxis.setTickMarksVisible(true);

dateAxis = new DateAxis("", TimeZone.getDefault());
dateAxis.setAutoRange(true);
@@ -132,8 +148,21 @@
renderer.setSeriesPaint(0,MAPerfsonarModel.inSeriesColor[1]);
((XYPlot)plot).setRenderer(1,renderer);

+
((XYPlot)plot).setDataset(2,((PerfsonarTimeSeries)datasets.get("Eps")));
+ renderer = new XYLineAndShapeRenderer(true,false);
+ renderer.setSeriesPaint(0,Color.red);
+ ((XYPlot)plot).setRenderer(2,renderer);

+
((XYPlot)plot).setDataset(3,((PerfsonarTimeSeries)datasets.get("Dps")));
+ renderer = new XYLineAndShapeRenderer(true,false);
+ renderer.setSeriesPaint(0,Color.black);
+ ((XYPlot)plot).setRenderer(3,renderer);
+
+ ((XYPlot)plot).setRangeAxis(1, countAxis);
+ ((XYPlot)plot).mapDatasetToRangeAxis(2, 1);
+ ((XYPlot)plot).mapDatasetToRangeAxis(3, 1);

+
final JFreeChart result = new JFreeChart(title,
new Font(null,Font.ITALIC,12),
plot, false);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataPanel.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataPanel.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -133,7 +133,7 @@
public TableColumnModel createColumnModel() {
TableColumnModel m = new DefaultTableColumnModel();
NumbersRenderer r = new NumbersRenderer();
- for (int i=0;i<11;i++) {
+ for (int i=0;i<14;i++) {
TableColumn t = new TableColumn(i);
t.setWidth(100);
t.setHeaderValue(MetaDataTableModel.columnNames[i]);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataTableModel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataTableModel.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetaDataTableModel.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -45,6 +45,8 @@
"Outbound utilization, %",
"Inbound utilization, bps",
"Outbound utilization, bps",
+ "Input errors",
+ "Output drops",
"Domain",
"Status"

@@ -64,7 +66,7 @@
if (dataList.size() == 0) return 0;
//UserData data = dataList.get(0);
//return data.getRowCount()+1;
- return 11;
+ return 14;
}

public int getRowCount() {
@@ -85,8 +87,10 @@
case 7: {return
data.getResponse(UserData.names[UserData.INDEX_IFUTILIZATION_OUT]);}
case 8: {return
data.getResponse(UserData.names[UserData.INDEX_IFBITS_IN]);}
case 9: {return
data.getResponse(UserData.names[UserData.INDEX_IFBITS_OUT]);}
- case 10: {return data.getEndpoint().getTitle();}
- case 11: {
+ case 10: {return
data.getResponse(UserData.names[UserData.INDEX_INERRORS]);}
+ case 11: {return
data.getResponse(UserData.names[UserData.INDEX_OUTDISCARDS]);}
+ case 12: {return data.getEndpoint().getTitle();}
+ case 13: {
return data.getResponse(IUserData.C_STATUS);
}
default: return "";
@@ -137,7 +141,9 @@
case 7: { dataList.sortBy(UserData.INDEX_IFUTILIZATION_OUT);
return; }
case 8: { dataList.sortBy(UserData.INDEX_IFBITS_IN); return; }
case 9: { dataList.sortBy(UserData.INDEX_IFBITS_OUT); return;
}
- case 10: { dataList.sortBy(UserData.INDEX_DOMAIN); return; }

+ case 10: { dataList.sortBy(UserData.INDEX_INERRORS); return; }
+ case 11: { dataList.sortBy(UserData.INDEX_OUTDISCARDS); return; }

+ case 12: { dataList.sortBy(UserData.INDEX_DOMAIN); return; }

default: { dataList.sort(); return; }
}


Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetricsOptionPanel.java

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSCountsDatum.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSCountsDatum.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSCountsDatum.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -39,7 +39,7 @@
super();
}
@Override
- protected String getDefaultType() {
+ public String getDefaultType() {
return "";
}
@Override

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSDiscardsDatum.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSDiscardsDatum.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSDiscardsDatum.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -29,11 +29,46 @@

package org.perfsonar.perfsonarui.plugins;

+import java.util.ArrayList;

+import org.perfsonar.perfsonarui.UnsupportedTypeException;
+
+
public class PSDiscardsDatum extends PSCountsDatum {
@Override
- protected String getDefaultType() {
+ public String getDefaultType() {
return "Dps";
}
-
+ /**
+ * To overcome current pionier implementation
+ */
+ protected ArrayList<String> initSupportedTypes() {
+ ArrayList<String> l = super.initSupportedTypes();
+ l.add("Bps");
+ return l;
+ }
+ /**
+ * To overcome current pionier implementation
+ */
+ @Override
+ public synchronized String getType() {
+ return getDefaultType();
+ }
+ //To overcome current pionier implementation
+ @Override
+ public void setValue(String value) throws UnsupportedTypeException {
+ try {
+ double d = Double.parseDouble(value);
+ if (Double.isNaN(d)) {
+ this.value = 0;
+ NaN = true;
+ }
+ else {
+ this.value = Math.round(d);
+ NaN = false;
+ }
+ } catch (Exception x) {
+ throw new UnsupportedTypeException(null,value,x);
+ }
+ }
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSErrorsDatum.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSErrorsDatum.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSErrorsDatum.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -29,10 +29,44 @@

package org.perfsonar.perfsonarui.plugins;

+import java.util.ArrayList;

+import org.perfsonar.perfsonarui.UnsupportedTypeException;
+
+
public class PSErrorsDatum extends PSCountsDatum {
@Override
- protected String getDefaultType() {
+ public String getDefaultType() {
return "Eps";
}
+ /**
+ * To overcome current pionier implementation
+ */
+ protected ArrayList<String> initSupportedTypes() {
+ ArrayList<String> l = super.initSupportedTypes();
+ l.add("Bps");
+ return l;
+ }
+ //To overcome current pionier implementation
+ @Override
+ public synchronized String getType() {
+ return getDefaultType();
+ }
+ //To overcome current pionier implementation
+ @Override
+ public void setValue(String value) throws UnsupportedTypeException {
+ try {
+ double d = Double.parseDouble(value);
+ if (Double.isNaN(d)) {
+ this.value = 0;
+ NaN = true;
+ }
+ else {
+ this.value = Math.round(d);
+ NaN = false;
+ }
+ } catch (Exception x) {
+ throw new UnsupportedTypeException(null,value,x);
+ }
+ }
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSTime.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSTime.java
2007-08-22 13:47:21 UTC (rev 2704)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSTime.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -45,7 +45,7 @@
setValue(value, type);
}
@Override
- protected String getDefaultType() {
+ public String getDefaultType() {
return "unix";
}
/**

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSTypedValue.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSTypedValue.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSTypedValue.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -39,6 +39,7 @@
//protected Number value;
protected String type;
protected boolean isDefaultType = true;
+ protected boolean NaN = false;

public PSTypedValue() {
super();
@@ -108,7 +109,7 @@
}
}

- protected abstract String getDefaultType();
+ public abstract String getDefaultType();


/**
@@ -118,5 +119,9 @@
*/
public abstract void setValue(String value) throws
UnsupportedTypeException ;

+ public synchronized boolean isNaN() {
+ return NaN;
+ }

+
}
\ No newline at end of file

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSUtilizationDatum.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSUtilizationDatum.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/plugins/PSUtilizationDatum.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -79,7 +79,7 @@
/**
* "bps" (bits per second) is the default type
*/
- protected String getDefaultType() {
+ public String getDefaultType() {
return units_bps;
}


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
2007-08-22 13:47:21 UTC (rev 2704)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
2007-08-22 20:09:31 UTC (rev 2705)
@@ -90,10 +90,17 @@

public void setDatum(String dataId, String type, PSTime time, PSDatum
datum) {
try {
- double dtime = time.getTime()*1000;
- double d = datum.getValue().doubleValue();
- if (Double.isNaN(d)) series.add(dtime, null);
- else series.add(dtime, Math.round(d));
+ double dtime = time.getTime()*1000;
+ if (datum.isNaN()) {
+ series.add(dtime, null); //Math.random()*100);
+ }
+ else {
+ double d = datum.getValue().doubleValue();
+ if (Double.isNaN(d)) series.add(dtime, null);
+ else series.add(dtime, Math.round(d));
+ }
+
+
} catch (NumberFormatException x) {
logger.warn(x);
}
@@ -105,6 +112,7 @@
double d = Double.parseDouble(value);
if (Double.isNaN(d)) series.add(dtime, null);
else series.add(dtime, Math.round(d));
+
} catch (NumberFormatException x) {
logger.warn(x);
}



  • perfsonar: r2705 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels plugins ui/panels, svnlog, 08/22/2007

Archive powered by MHonArc 2.6.16.

Top of Page