Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2850 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels ui/actions ui/panels

Subject: perfsonar development work

List archive

perfsonar: r2850 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels ui/actions ui/panels


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2850 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels ui/actions ui/panels
  • Date: Sat, 15 Sep 2007 10:01:24 -0400

Author: nina
Date: 2007-09-15 10:01:23 -0400 (Sat, 15 Sep 2007)
New Revision: 2850

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAMetadataList.java

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

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

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

branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/SetupDataRequestAction.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
Log:
Support for errors/drops in bar chart and support for simultaneous display
of utilization and errors/drops at the bottom chart

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAMetadataList.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAMetadataList.java
2007-09-15 13:59:09 UTC (rev 2849)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/MAMetadataList.java
2007-09-15 14:01:23 UTC (rev 2850)
@@ -106,6 +106,14 @@
return octets;
}

+ public Number getErrors(int index) {
+ if (get(index)==null) return DoubleZERO;
+ return
getDoubleValue(getUserData(index).getResponse(UserData.names[UserData.INDEX_INERRORS]));
+ }
+ public Number getDiscards(int index) {
+ if (get(index)==null) return DoubleZERO;
+ return
getDoubleValue(getUserData(index).getResponse(UserData.names[UserData.INDEX_OUTDISCARDS]));
+ }
public Double getCapacity(int index) {
Double utilization;
try {
@@ -118,4 +126,18 @@
public UserData getUserData(int index) {
return (UserData) super.get(index);
}
+
+ protected Double getDoubleValue(String value) {
+ Double v;
+ try {
+ v = new Double(value);
+
+ if (v.isNaN())
+ return DoubleZERO;
+ else if (v.doubleValue() < eps) return DoubleZERO;
+ else return v;
+ } catch (Exception x) {
+ return DoubleZERO;
+ }
+ }
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/BarChartPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/BarChartPanel.java
2007-09-15 13:59:09 UTC (rev 2849)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/BarChartPanel.java
2007-09-15 14:01:23 UTC (rev 2850)
@@ -264,9 +264,11 @@
private JFreeChart createChart(MAMetadataList dataList) {
dataset = new MetadataChartSet(dataList);
dataset.addChangeListener(this);
- selectedItemPaint = new Paint[2];
- selectedItemPaint[0] = new Color(0,255,0,200);
- selectedItemPaint[1] = new Color(0,0,255,200);
+ selectedItemPaint = new Paint[4];
+ selectedItemPaint[0] = new Color(0,255,0,200); //in
+ selectedItemPaint[1] = new Color(0,0,255,200); //out
+ selectedItemPaint[2] = new Color(255,0,0,200); //errors
+ selectedItemPaint[3] = new Color(0,0,0,200); //drops
LayeredBarRenderer barRenderer = new LayeredBarRenderer() {
/**
* Comment for <code>serialVersionUID</code>
@@ -354,11 +356,17 @@
barRenderer.setSeriesPaint(MetadataChartSet.SERIES_CAPACITY, new
Color(255,255,255,50));

barRenderer.setSeriesPaint(MetadataChartSet.SERIES_IN,MAPerfsonarModel.inSeriesColor[0]);

barRenderer.setSeriesPaint(MetadataChartSet.SERIES_OUT,MAPerfsonarModel.outSeriesColor[0]);
+ barRenderer.setSeriesPaint(MetadataChartSet.SERIES_ERRORS,new
Color(200,0,0,50));
+ barRenderer.setSeriesPaint(MetadataChartSet.SERIES_DISCARDS,new
Color(20,20,20,50));

+
barRenderer.setSeriesBarWidth(MetadataChartSet.SERIES_CAPACITY, 1);
barRenderer.setSeriesBarWidth(MetadataChartSet.SERIES_IN,1);
- barRenderer.setSeriesBarWidth(MetadataChartSet.SERIES_OUT,0.4);
+ barRenderer.setSeriesBarWidth(MetadataChartSet.SERIES_OUT,0.6);
+ barRenderer.setSeriesBarWidth(MetadataChartSet.SERIES_ERRORS,0.3);
+ barRenderer.setSeriesBarWidth(MetadataChartSet.SERIES_DISCARDS,0.1);


+
//barRenderer.setBaseItemLabelGenerator(
barRenderer.setItemLabelGenerator(
new StandardCategoryItemLabelGenerator() {
@@ -393,7 +401,8 @@

barRenderer.setSeriesItemLabelsVisible(MetadataChartSet.SERIES_CAPACITY,
Boolean.FALSE);
barRenderer.setSeriesItemLabelsVisible(MetadataChartSet.SERIES_IN,
Boolean.TRUE);
barRenderer.setSeriesItemLabelsVisible(MetadataChartSet.SERIES_OUT,
Boolean.TRUE);
-
+
barRenderer.setSeriesItemLabelsVisible(MetadataChartSet.SERIES_ERRORS,
Boolean.TRUE);
+
barRenderer.setSeriesItemLabelsVisible(MetadataChartSet.SERIES_DISCARDS,
Boolean.TRUE);
barRenderer.setItemLabelPaint(Color.BLACK);


@@ -425,7 +434,7 @@
if (action instanceof ITimeSet)

((UserData)psModel.getUserData()).lastSeconds(((ITimeSet)action).getTimeInterval());
action.actionPerformed(null);
- } else
JOptionPane.showMessageDialog(null,item.getColumnKey());
+ } else
JOptionPane.showMessageDialog(null,item.getColumnKey() + "
,"+item.getRowKey());

} catch (Exception x) {
//smth else went wrong

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetadataChartSet.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetadataChartSet.java
2007-09-15 13:59:09 UTC (rev 2849)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/MetadataChartSet.java
2007-09-15 14:01:23 UTC (rev 2850)
@@ -42,7 +42,7 @@
* Comment for <code>serialVersionUID</code>
*/
private static final long serialVersionUID = 7076933057921402071L;
- public static String[] titles = {"inbound","outbound"};
+ public static String[] titles =
{"capacity","inbound","outbound","errors","discards"};
protected MAMetadataList dataList = null;
protected Vector<String> types = null;
protected Number min = Plot.ZERO;
@@ -52,6 +52,8 @@
public static final int SERIES_CAPACITY = 0;
public static final int SERIES_IN = 1;
public static final int SERIES_OUT = 2;
+ public static final int SERIES_ERRORS = 3;
+ public static final int SERIES_DISCARDS = 4;

protected int pageSize = 30;
protected int page = 0;
@@ -68,9 +70,8 @@
dataList.addObserver(this);
types = new Vector<String>();
types.add("");
- types.add(titles[0]);
- types.add(titles[1]);
- //types.add(titles[2]);
+ for (int i=1; i < titles.length;i++)
+ types.add(titles[i]);
}

/* (non-Javadoc)
@@ -126,16 +127,20 @@
*/
public Number getValue(Comparable arg0, Comparable arg1) {
int i = dataList.indexOf(arg1);
- if (arg0.equals(titles[0])) {
+ if (arg0.equals(titles[SERIES_IN])) {
if (utilization)
return dataList.getUtilizationIn(i);
else
return dataList.getMbpsIn(i);
- } else if (arg0.equals(titles[1])) {
+ } else if (arg0.equals(titles[SERIES_OUT])) {
if (utilization)
return dataList.getUtilizationOut(i);
else
- return dataList.getMbpsOut(i);
+ return dataList.getMbpsOut(i);
+ } else if (arg0.equals(titles[SERIES_ERRORS])) {
+ return dataList.getErrors(i);
+ } else if (arg0.equals(titles[SERIES_DISCARDS])) {
+ return dataList.getDiscards(i);
} else if (arg0.equals("")) {
if (showCapacity) return max;
else return min;
@@ -186,7 +191,11 @@
if (utilization)
return dataList.getUtilizationOut(index);
else
- return dataList.getMbpsOut(index);
+ return dataList.getMbpsOut(index);
+ case SERIES_ERRORS:
+ return dataList.getErrors(index);
+ case SERIES_DISCARDS:
+ return dataList.getDiscards(index);
case SERIES_CAPACITY:
if (showCapacity) return max;
else return min;

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/RadarChartPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/RadarChartPanel.java
2007-09-15 13:59:09 UTC (rev 2849)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/RadarChartPanel.java
2007-09-15 14:01:23 UTC (rev 2850)
@@ -146,8 +146,12 @@
@Override
public String generateURL(CategoryDataset dataset,
int series,
int category) {
+ try {
String url = super.generateURL(dataset, series, category);
return url;
+ } catch (Exception x) {
+ return "";
+ }
}
});


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/SetupDataRequestAction.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/SetupDataRequestAction.java
2007-09-15 13:59:09 UTC (rev 2849)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/actions/SetupDataRequestAction.java
2007-09-15 14:01:23 UTC (rev 2850)
@@ -84,9 +84,9 @@
@Override
public void run(ActionEvent arg0) {

- if (request == null) return ;
- if (response != null)
- response.clear();
+ if (request == null) return ;
+ //if (response != null)
+ //response.clear();

String caption = "";
caption = userData.toString();

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
2007-09-15 13:59:09 UTC (rev 2849)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/PerfsonarTimeSeries.java
2007-09-15 14:01:23 UTC (rev 2850)
@@ -125,6 +125,8 @@
* @see
org.perfsonar.perfsonarui.ITimeValueResponse#setUserData(org.perfsonar.perfsonarui.UserData)
*/
public void setUserData(IUserData userData) {
+ if (!userData.equals(this.userData))
+ clear();
this.userData = userData;
try {
timeStart = Long
@@ -143,7 +145,6 @@

public void finalizeResponse() {
series.setNotify(true);
-
}
@Override
public String toString() {



  • perfsonar: r2850 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: ma ma/ui/panels ui/actions ui/panels, svnlog, 09/15/2007

Archive powered by MHonArc 2.6.16.

Top of Page