Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r897 committed - Merge AppletIssue120 branch into trunk

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r897 committed - Merge AppletIssue120 branch into trunk


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r897 committed - Merge AppletIssue120 branch into trunk
  • Date: Tue, 11 Feb 2014 09:20:23 +0000

Revision: 897
Author:

Date: Tue Feb 11 09:19:57 2014 UTC
Log: Merge AppletIssue120 branch into trunk
http://code.google.com/p/ndt/source/detail?r=897

Added:
/trunk/Admin/src
/trunk/janalyze/src/edu
Deleted:
/trunk/Admin/Admin.java
/trunk/janalyze/src/DBConfFrame.java
/trunk/janalyze/src/FilterFrame.java
/trunk/janalyze/src/Helpers.java
/trunk/janalyze/src/JAnalyze.java
/trunk/janalyze/src/LoadingDBFrame.java
/trunk/janalyze/src/LoadingFrame.java
/trunk/janalyze/src/MaxPeakInfo.java
/trunk/janalyze/src/MinPeakInfo.java
/trunk/janalyze/src/PeakInfo.java
/trunk/janalyze/src/PropertyListener.java
/trunk/janalyze/src/ResultsContainer.java
/trunk/janalyze/src/ResultsList.java
/trunk/janalyze/src/SimpleTextPane.java
/trunk/janalyze/src/SnaplogFrame.java
/trunk/janalyze/src/SwingWorker.java
Modified:
/trunk
/trunk/Admin/Makefile.am
/trunk/admin.html
/trunk/janalyze/MANIFEST.MF
/trunk/janalyze/Makefile.am

=======================================
--- /trunk/Admin/Admin.java Wed Jun 30 15:40:21 2004 UTC
+++ /dev/null
@@ -1,258 +0,0 @@
-/* This applet provides an administrator view of the NDT usage
- * statistics. It was originally developed for the SC-03 conference.
- * An admin script will run to collect the necessary data. This data
- * is then feed into this applet via the PARM/VALUE pairs in the html
- * file.
- *
- * This applet simply draws the bar graph that appears on the
- * html page.
- *
- * Admin.java by Richard A. Carlson - September 25, 2003
- */
-
-import java.awt.*;
-import java.awt.geom.*;
-import java.awt.font.*;
-import java.awt.image.*;
-import java.applet.Applet;
-
-public class Admin extends Applet {
-
- Color fill, outline, textcolor;
- Font font;
- FontMetrics metrics;
- private String TARGET1 = "Fault";
- private String TARGET2 = "RTT";
- private String TARGET3 = "Dial-up";
- private String TARGET4 = "T1";
- private String TARGET5 = "Enet";
- private String TARGET6 = "T3";
- private String TARGET7 = "FastE";
- private String TARGET8 = "OC-12";
- private String TARGET9 = "GigE";
- private String TARGET10 = "OC-48";
- private String TARGET11 = "tenGE";
- private String TARGET12 = "Total";
-
-
- public void init() {
-
- fill = new Color(0,255,128); // (RGB values)
- outline = Color.black;
-
- font = new Font("SansSerif", Font.PLAIN, 12);
- metrics = this.getFontMetrics(font);
- }
-
-
- public void paint(Graphics g) {
-
- int Fault, RTT, Dialup, T1, Enet, T3, FastE;
- int OC12, GigE, OC48, tenGE, Total, i;
- int f;
- String val;
-
- val = getParameter(TARGET1);
- // System.err.println("Fault = " + val);
- Fault = Integer.parseInt(val);
- val = getParameter(TARGET2);
- // System.err.println("RTT = " + val);
- RTT = Integer.parseInt(val);
- val = getParameter(TARGET3);
- // System.err.println("Dialup = " + val);
- Dialup = Integer.parseInt(val);
- val = getParameter(TARGET4);
- // System.err.println("T1 = " + val);
- T1 = Integer.parseInt(val);
- val = getParameter(TARGET5);
- // System.err.println("Enet = " + val);
- Enet = Integer.parseInt(val);
- val = getParameter(TARGET6);
- // System.err.println("T3 = " + val);
- T3 = Integer.parseInt(val);
- val = getParameter(TARGET7);
- // System.err.println("FastE = " + val);
- FastE = Integer.parseInt(val);
- val = getParameter(TARGET8);
- // System.err.println("OC12 = " + val);
- OC12 = Integer.parseInt(val);
- val = getParameter(TARGET9);
- // System.err.println("GigE = " + val);
- GigE = Integer.parseInt(val);
- val = getParameter(TARGET10);
- // System.err.println("OC48 = " + val);
- OC48 = Integer.parseInt(val);
- val = getParameter(TARGET11);
- // System.err.println("tenGE = " + val);
- tenGE = Integer.parseInt(val);
- val = getParameter(TARGET12);
- Total = Integer.parseInt(val);
-
- g.setFont(font);
-
- // draw X/Y axis lines with tick marks on the Y axis
- g.setColor(outline);
- g.drawLine(60, 350, 60, 50);
- g.drawLine(45, 350, 510, 350);
- g.drawString("0", 30, 355);
- g.drawLine(45, 290, 60, 290);
- g.drawString("20", 28, 295);
- g.drawLine(45, 230, 60, 230);
- g.drawString("40", 28, 235);
- g.drawLine(45, 170, 60, 170);
- g.drawString("60", 28, 175);
- g.drawLine(45, 110, 60, 110);
- g.drawString("80", 28, 115);
- g.drawLine(45, 50, 60, 50);
- g.drawString("100", 23, 55);
-
- // draw green boxes representing bars for each possible link type
- f = (int)(((double)Fault/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(70, (349 - f), 30, (1 + f));
- // g.drawString("Fault", 70, 370);
- g.setColor(outline);
- g.drawRect(70, (349 - f), 30, (1 + f));
- g.drawString("Fault", 70, 370);
- if (Fault > 0) {
- val = "(" + Integer.toString(Fault) + ")";
- g.drawString(val, (70 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- f = (int)(((double)RTT/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(110, (349 - f), 30, (1 + f));
- // g.drawString("RTT", 110, 385);
- g.setColor(outline);
- g.drawRect(110, (349 - f), 30, (1 + f));
- g.drawString("RTT", 110, 385);
- if (RTT > 0) {
- val = "(" + Integer.toString(RTT) + ")";
- g.drawString(val, (110 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- f = (int)(((double)Dialup/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(150, (349 - f), 30, (1 + f));
- // g.drawString("Dial-up", 150, 370);
- g.setColor(outline);
- g.drawRect(150, (349 - f), 30, (1 + f));
- g.drawString("Dial-up", 150, 370);
- if (Dialup > 0) {
- val = "(" + Integer.toString(Dialup) + ")";
- g.drawString(val, (150 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- f = (int)(((double)T1/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(190, (349 - f), 30, (1 + f));
- // g.drawString("Cable/DSL", 180, 385);
- g.setColor(outline);
- g.drawRect(190, (349 - f), 30, (1 + f));
- g.drawString("Cable/DSL", 180, 385);
- if (T1 > 0) {
- val = "(" + Integer.toString(T1) + ")";
- g.drawString(val, (190 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- f = (int)(((double)Enet/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(230, (349 - f), 30, (1 + f));
- // g.drawString("Ethernet", 230, 370);
- g.setColor(outline);
- g.drawRect(230, (349 - f), 30, (1 + f));
- g.drawString("Ethernet", 230, 370);
- if (Enet > 0) {
- val = "(" + Integer.toString(Enet) + ")";
- g.drawString(val, (230 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- f = (int)(((double)T3/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(270, (349 - f), 30, (1 + f));
- // g.drawString("T3/DS3", 270, 385);
- g.setColor(outline);
- g.drawRect(270, (349 - f), 30, (1 + f));
- g.drawString("T3/DS3", 270, 385);
- if (T3 > 0) {
- i = (int)(((double)T3/300)*(double)Total) + 1;
- val = "(" + Integer.toString(T3) + ")";
- g.drawString(val, (270 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- f = (int)(((double)FastE/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(310, (349 - f), 30, (1 + f));
- // g.drawString("FastEnet", 310, 370);
- g.setColor(outline);
- g.drawRect(310, (349 - f), 30, (1 + f));
- g.drawString("FastEnet", 310, 370);
- if (FastE > 0) {
- val = "(" + Integer.toString(FastE) + ")";
- g.drawString(val, (310 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- f = (int)(((double)OC12/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(350, (349 - f), 30, (1 + f));
- // g.drawString("OC-12", 350, 385);
- g.setColor(outline);
- g.drawRect(350, (349 - f), 30, (1 + f));
- g.drawString("OC-12", 350, 385);
- if (OC12 > 0) {
- val = "(" + Integer.toString(OC12) + ")";
- g.drawString(val, (360 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- f = (int)(((double)GigE/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(390, (349 - f), 30, (1 + f));
- // g.drawString("GigEnet", 390, 370);
- g.setColor(outline);
- g.drawRect(390, (349 - f), 30, (1 + f));
- g.drawString("GigEnet", 390, 370);
- if (GigE > 0) {
- val = "(" + Integer.toString(GigE) + ")";
- g.drawString(val, (390 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- f = (int)(((double)OC48/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(430, (349 - f), 30, (1 + f));
- // g.drawString("OC-48", 430, 385);
- g.setColor(outline);
- g.drawRect(430, (349 - f), 30, (1 + f));
- g.drawString("OC-48", 430, 385);
- if (OC48 > 0) {
- val = "(" + Integer.toString(OC48) + ")";
- g.drawString(val, (430 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- f = (int)(((double)tenGE/(double)Total)*300);
- g.setColor(fill);
- g.fillRect(470, (349 - f), 30, (1 + f));
- // g.drawString("10 GigE", 470, 370);
- g.setColor(outline);
- g.drawRect(470, (349 - f), 30, (1 + f));
- g.drawString("10 GigE", 470, 370);
- if (tenGE > 0) {
- val = "(" + Integer.toString(tenGE) + ")";
- g.drawString(val, (470 + ((30 - metrics.stringWidth(val))/2)), (339 - f));
- }
-
- font = new Font("SansSerif", Font.BOLD, 18);
- g.setFont(font);
- g.setColor(outline);
- g.drawString("Bottleneck Link Type (Sub-Total)", 150, 40);
- font = new Font("SansSerif", Font.BOLD, 16);
- g.setFont(font);
- g.drawString("P", 5, 140);
- g.drawString("E", 5, 160);
- g.drawString("R", 5, 180);
- g.drawString("C", 5, 200);
- g.drawString("E", 5, 220);
- g.drawString("N", 5, 240);
- g.drawString("T", 5, 260);
- }
-
-}
=======================================
--- /trunk/janalyze/src/DBConfFrame.java Thu Nov 15 21:17:15 2007 UTC
+++ /dev/null
@@ -1,76 +0,0 @@
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.BoxLayout;
-import javax.swing.JLabel;
-import javax.swing.JTextField;
-import javax.swing.JPasswordField;
-import java.awt.Container;
-
-public class DBConfFrame extends JFrame
-{
- private static final long serialVersionUID = 1L;
- private JTextField driver = new JTextField(20);
- private JTextField dsn = new JTextField(20);
- private JTextField uid = new JTextField(20);
- private JPasswordField pwd = new JPasswordField(20);
-
- public DBConfFrame(JAnalyze mainWindow) {
-
- Container cp = getContentPane();
- cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
- JPanel panel = new JPanel();
- JPanel tmpPanel = new JPanel();
- panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
- panel.add(new JLabel("Driver:"));
- driver.setText(mainWindow.getProperties().getProperty("driver", "com.mysql.jdbc.Driver"));
- driver.getDocument().addDocumentListener(new PropertyListener(mainWindow, "driver"));
- panel.add(driver);
- tmpPanel.add(panel);
- cp.add(tmpPanel);
- panel = new JPanel();
- tmpPanel = new JPanel();
- panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
- panel.add(new JLabel("DSN:"));
- dsn.setText(mainWindow.getProperties().getProperty("dsn", "jdbc:mysql://localhost/test"));
- dsn.getDocument().addDocumentListener(new PropertyListener(mainWindow, "dsn"));
- panel.add(dsn);
- tmpPanel.add(panel);
- cp.add(tmpPanel);
- panel = new JPanel();
- tmpPanel = new JPanel();
- panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
- panel.add(new JLabel("UID:"));
- uid.setText(mainWindow.getProperties().getProperty("uid", ""));
- uid.getDocument().addDocumentListener(new PropertyListener(mainWindow, "uid"));
- panel.add(uid);
- tmpPanel.add(panel);
- cp.add(tmpPanel);
- panel = new JPanel();
- tmpPanel = new JPanel();
- panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
- panel.add(new JLabel("PWD:"));
- pwd.setText(mainWindow.getProperties().getProperty("pwd", ""));
- pwd.getDocument().addDocumentListener(new PropertyListener(mainWindow, "pwd"));
- panel.add(pwd);
- tmpPanel.add(panel);
- cp.add(tmpPanel);
-
- setSize(270, 150);
- }
-
- public String getDriver() {
- return driver.getText();
- }
-
- public String getDSN() {
- return dsn.getText();
- }
-
- public String getUID() {
- return uid.getText();
- }
-
- public String getPWD() {
- return new String(pwd.getPassword());
- }
-}
=======================================
--- /trunk/janalyze/src/FilterFrame.java Thu Nov 15 21:17:15 2007 UTC
+++ /dev/null
@@ -1,299 +0,0 @@
-import javax.swing.JFrame;
-import javax.swing.JScrollPane;
-import javax.swing.JPanel;
-import javax.swing.BoxLayout;
-import javax.swing.JCheckBox;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JComboBox;
-import javax.swing.border.TitledBorder;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Vector;
-import java.util.HashSet;
-import java.util.StringTokenizer;
-
-import java.awt.Dimension;
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-public class FilterFrame extends JFrame
-{
- private JAnalyze mainWindow;
- private static final long serialVersionUID = 1L;
- private Collection<ResultsContainer> results;
- private Collection<String> disabled = new HashSet<String>();
-
- private final Map<String, Integer> ips = new HashMap<String, Integer>();
- private int mismatchFilter;
- private int cableFaultFilter = 2;
- private int congestionFilter = 2;
- private int duplexFilter = 2;
- private int newCongestionFilter = 2;
- private int initialPeakSpeedFilter = 4;
-
- public FilterFrame(JAnalyze mainWindow, Collection<ResultsContainer> results) {
- this.mainWindow = mainWindow;
- this.results = results;
-
- resultsChange();
-
- StringTokenizer st = new StringTokenizer(mainWindow.getProperties().getProperty("disabled", ""), ",");
- while (st.hasMoreTokens()) {
- disabled.add(st.nextToken());
- }
-
- setSize(400, 350);
- }
-
- public Collection<ResultsContainer> getResults() {
- Collection<ResultsContainer> newResults = new Vector<ResultsContainer>();
- for (ResultsContainer result : results) {
- if (mismatchFilter != 2 && result.getMismatch() != mismatchFilter)
- continue;
- if (cableFaultFilter != 2 && result.getCable() != cableFaultFilter)
- continue;
- if (congestionFilter != 2 && result.getCongestion() != congestionFilter)
- continue;
- if (duplexFilter != 2 && result.getDuplex() != duplexFilter)
- continue;
- if (newCongestionFilter != 2 && result.getNewCongestion() != newCongestionFilter)
- continue;
- if (initialPeakSpeedFilter != 4 && result.getInitialPeakSpeedEquality() != initialPeakSpeedFilter)
- continue;
- if (ips.get(result.getIP()).equals(1)) {
- newResults.add(result);
- }
- }
- return newResults;
- }
-
- public void resultsChange() {
- Container cp = getContentPane();
- cp.removeAll();
-
- Map<String, Integer> oldIPs = new HashMap<String, Integer>(ips);
-
- ips.clear();
- for (ResultsContainer result : results) {
- if (!oldIPs.containsKey(result.getIP())) {
- ips.put(result.getIP(), disabled.contains(result.getIP()) ? 0 : 1);
- }
- else {
- ips.put(result.getIP(), oldIPs.get(result.getIP()));
- }
- }
-
- cp.setLayout(new BorderLayout());
- JPanel leftPanel = new JPanel();
- leftPanel.setLayout(new BorderLayout());
- final JPanel ipsPanel = new JPanel();
- ipsPanel.setBorder(new TitledBorder("Show IPs"));
- ipsPanel.setLayout(new BoxLayout(ipsPanel, BoxLayout.Y_AXIS));
- if (ips.keySet().size() == 0) {
- ipsPanel.add(new JLabel(" "));
- }
- else {
- JPanel tmpPanel = new JPanel();
- tmpPanel.setBorder(new TitledBorder("select IPs"));
- JButton allButton = new JButton("all");
- allButton.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- for (Component component : ipsPanel.getComponents()) {
- JCheckBox checkBox = (JCheckBox) component;
- checkBox.setSelected(true);
- }
- }
- });
- allButton.setPreferredSize(new Dimension(55, 20));
- JButton noneButton = new JButton("none");
- noneButton.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- for (Component component : ipsPanel.getComponents()) {
- JCheckBox checkBox = (JCheckBox) component;
- checkBox.setSelected(false);
- }
- }
- });
- noneButton.setPreferredSize(new Dimension(70, 20));
- tmpPanel.add(allButton);
- tmpPanel.add(noneButton);
- leftPanel.add(tmpPanel, BorderLayout.SOUTH);
- }
- for (String ip : ips.keySet()) {
- JCheckBox checkBox = new JCheckBox(ip, ips.get(ip) == 1) {
- private static final long serialVersionUID =
1L;
-
- public void setSelected(boolean value) {
- super.setSelected(value);
- fireActionPerformed(new ActionEvent(FilterFrame.this,
- ActionEvent.ACTION_PERFORMED,
- ""));
- }
- };
- checkBox.addActionListener( new IPCheckBoxActionListener(checkBox, ip, disabled));
- ipsPanel.add(checkBox);
- }
- leftPanel.add(new JScrollPane(ipsPanel));
- cp.add(leftPanel, BorderLayout.WEST);
-
- JPanel applyPanel = new JPanel();
- JButton applyButton = new JButton("Apply");
- applyButton.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- mainWindow.rebuildResultsList();
- }
- });
- applyPanel.add(applyButton);
- cp.add(applyPanel, BorderLayout.SOUTH);
-
- JPanel optPanel = new JPanel();
- optPanel.setLayout(new BoxLayout(optPanel, BoxLayout.Y_AXIS));
- String[] optStrings = {"no", "yes", "both"};
-
- JComboBox mismatchBox = new JComboBox(optStrings);
- mismatchBox.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- mismatchFilter = ((JComboBox) e.getSource()).getSelectedIndex();
- mainWindow.getProperties().setProperty("mismatchFilter", Integer.toString(mismatchFilter));
- }
- });
-
- mismatchFilter = Integer.parseInt(mainWindow.getProperties().getProperty("mismatchFilter", "2"));
- mismatchBox.setSelectedIndex(mismatchFilter);
- JPanel horizontalPanel = new JPanel();
- horizontalPanel.setLayout(new BoxLayout(horizontalPanel, BoxLayout.X_AXIS));
- horizontalPanel.add(new JLabel("Mismatch: "));
- horizontalPanel.add(mismatchBox);
- optPanel.add(horizontalPanel);
-
- JComboBox cableFaultBox = new JComboBox(optStrings);
- cableFaultBox.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- cableFaultFilter = ((JComboBox) e.getSource()).getSelectedIndex();
- mainWindow.getProperties().setProperty("cableFaultFilter", Integer.toString(cableFaultFilter));
- }
- });
-
- cableFaultFilter = Integer.parseInt(mainWindow.getProperties().getProperty("cableFaultFilter", "2"));
- cableFaultBox.setSelectedIndex(cableFaultFilter);
- horizontalPanel = new JPanel();
- horizontalPanel.setLayout(new BoxLayout(horizontalPanel, BoxLayout.X_AXIS));
- horizontalPanel.add(new JLabel("Cable fault: "));
- horizontalPanel.add(cableFaultBox);
- optPanel.add(horizontalPanel);
-
- JComboBox congestionBox = new JComboBox(optStrings);
- congestionBox.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- congestionFilter = ((JComboBox) e.getSource()).getSelectedIndex();
- mainWindow.getProperties().setProperty("congestionFilter", Integer.toString(congestionFilter));
- }
- });
-
- congestionFilter = Integer.parseInt(mainWindow.getProperties().getProperty("congestionFilter", "2"));
- congestionBox.setSelectedIndex(congestionFilter);
- horizontalPanel = new JPanel();
- horizontalPanel.setLayout(new BoxLayout(horizontalPanel, BoxLayout.X_AXIS));
- horizontalPanel.add(new JLabel("Congestion: "));
- horizontalPanel.add(congestionBox);
- optPanel.add(horizontalPanel);
-
- JComboBox duplexBox = new JComboBox(optStrings);
- duplexBox.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- duplexFilter = ((JComboBox) e.getSource()).getSelectedIndex();
- mainWindow.getProperties().setProperty("duplexFilter", Integer.toString(duplexFilter));
- }
- });
-
- duplexFilter = Integer.parseInt(mainWindow.getProperties().getProperty("duplexFilter", "2"));
- duplexBox.setSelectedIndex(duplexFilter);
- horizontalPanel = new JPanel();
- horizontalPanel.setLayout(new BoxLayout(horizontalPanel, BoxLayout.X_AXIS));
- horizontalPanel.add(new JLabel("Duplex: "));
- horizontalPanel.add(duplexBox);
- optPanel.add(horizontalPanel);
-
- JComboBox newCongestionBox = new JComboBox(optStrings);
- newCongestionBox.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- newCongestionFilter = ((JComboBox) e.getSource()).getSelectedIndex();
- mainWindow.getProperties().setProperty("newCongestionFilter",
- Integer.toString(newCongestionFilter));
- }
- });
-
- newCongestionFilter=Integer.parseInt(mainWindow.getProperties().getProperty("newCongestionFilter","2"));
- newCongestionBox.setSelectedIndex(newCongestionFilter);
- horizontalPanel = new JPanel();
- horizontalPanel.setLayout(new BoxLayout(horizontalPanel, BoxLayout.X_AXIS));
- horizontalPanel.add(new JLabel("New congestion: "));
- horizontalPanel.add(newCongestionBox);
- optPanel.add(horizontalPanel);
-
- JComboBox initialPeakSpeedBox = new JComboBox(new String[] {"n/a", "equal", "greater", "less", "all"});
- initialPeakSpeedBox.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- initialPeakSpeedFilter = ((JComboBox) e.getSource()).getSelectedIndex();
- mainWindow.getProperties().setProperty("initialPeakSpeedFilter",
- Integer.toString(initialPeakSpeedFilter));
- }
- });
-
- initialPeakSpeedFilter=Integer.parseInt(mainWindow.getProperties().getProperty("initialPeakSpeedFilter","4"));
- initialPeakSpeedBox.setSelectedIndex(initialPeakSpeedFilter);
- horizontalPanel = new JPanel();
- horizontalPanel.setLayout(new BoxLayout(horizontalPanel, BoxLayout.X_AXIS));
- horizontalPanel.add(new JLabel("Initial peak speed: "));
- horizontalPanel.add(initialPeakSpeedBox);
- optPanel.add(horizontalPanel);
-
- JPanel tmpPanel = new JPanel();
- tmpPanel.add(new JScrollPane(optPanel));
- cp.add(tmpPanel);
-
- validate();
- cp.repaint();
- }
-
- class IPCheckBoxActionListener implements ActionListener {
- private JCheckBox checkBox;
- private String ip;
- private Collection<String> disabled;
-
- IPCheckBoxActionListener(JCheckBox checkBox, String ip, Collection<String> disabled) {
- this.checkBox = checkBox;
- this.ip = ip;
- this.disabled = disabled;
- }
-
- public void actionPerformed(ActionEvent e) {
- if (checkBox.isSelected()) {
- ips.put(ip, 1);
- disabled.remove(ip);
- }
- else {
- ips.put(ip, 0);
- if (!disabled.contains(ip)) {
- disabled.add(ip);
- }
- }
- StringBuffer newDisabled = new StringBuffer();
- boolean first = true;
- for (String ip : disabled) {
- if (!first) {
- newDisabled.append(",");
- }
- newDisabled.append(ip);
- first = false;
- }
- mainWindow.getProperties().setProperty("disabled", newDisabled.toString());
- }
- }
-}
=======================================
--- /trunk/janalyze/src/Helpers.java Tue Nov 13 19:16:15 2007 UTC
+++ /dev/null
@@ -1,7 +0,0 @@
-
-public class Helpers {
- public static String formatDouble(double val, int precision) {
- String format_string = "%1$." + precision + "f";
- return String.format(format_string, val);
- }
-}
=======================================
--- /trunk/janalyze/src/JAnalyze.java Tue Nov 13 19:16:15 2007 UTC
+++ /dev/null
@@ -1,681 +0,0 @@
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.ListSelectionModel;
-import javax.swing.UIManager;
-import javax.swing.JFileChooser;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.JTextArea;
-
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.Collection;
-import java.util.Vector;
-import java.util.StringTokenizer;
-import java.util.Properties;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.Statement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import de.progra.charting.DefaultChart;
-import de.progra.charting.model.EditableChartDataModel;
-import de.progra.charting.render.LineChartRenderer;
-import de.progra.charting.swing.ChartPanel;
-
-public class JAnalyze extends JFrame
-{
- private static final long serialVersionUID = 1L;
-
- JMenuBar menuBar = new JMenuBar();
- JMenu fileMenu = new JMenu("File");
- JMenu optionsMenu = new JMenu("Options");
- JMenu actionsMenu = new JMenu("Actions");
- JMenuItem exitMenuItem = new JMenuItem("Exit");
- JMenuItem loadMenuItem = new JMenuItem("Load");
- JMenuItem loadDBMenuItem = new JMenuItem("Load from DB");
- JMenuItem filterMenuItem = new JMenuItem("Filter");
- JMenuItem snaplogMenuItem = new JMenuItem("Snaplogs");
- JMenuItem dbConfMenuItem = new JMenuItem("DB conf");
- JMenu snaplogsMenu = new JMenu("Snaplogs");
- JMenuItem viewSnaplogMenuItem = new JMenuItem("View");
- JMenuItem plotSnaplogMenuItem = new JMenuItem("Plot");
- JMenuItem plotSnaplogCWNDMenuItem = new JMenuItem("Plot CWND");
- JMenu tcpdumpsMenu = new JMenu("Tcpdumps");
- JMenuItem viewTcpdumpMenuItem = new JMenuItem("View");
- JMenuItem plotTcpdumpMenuItem = new JMenuItem("Plot");
- JMenu cputimesMenu = new JMenu("Cputimes");
- JMenuItem viewCputimeMenuItem = new JMenuItem("View");
- JFileChooser fc;
- final Properties properties = new Properties();
- final File propertyFile = new File(System.getenv("HOME") + "/.jAnalyze.properties");
-
- FilterFrame filterFrame = null;
- DBConfFrame dbConfFrame = null;
- SnaplogFrame snaplogFrame = null;
-
- JPanel listPanel = new JPanel();
- JPanel infoPanel = new JPanel();
-
- private boolean stopLoading;
-
- private Collection<ResultsContainer> results = new Vector<ResultsContainer>();
-
- public JAnalyze()
- {
- // Title
- setTitle("JAnalyze v0.9.1");
-
- try {
- properties.load(new FileInputStream(propertyFile));
- }
- catch (FileNotFoundException e) {
- // do nothing
- }
- catch (IOException e) {
- // do nothing
- }
-
- dbConfFrame = new DBConfFrame(this);
- snaplogFrame = new SnaplogFrame(this);
- filterFrame = new FilterFrame(JAnalyze.this, results);
-
- addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent event) {
- try {
- properties.store(new FileOutputStream(propertyFile), "JAnalyze properties file");
- }
- catch (FileNotFoundException e) {
- // do nothing
- }
- catch (IOException e) {
- // do nothing
- }
- }
- });
-
- // Menu
- loadMenuItem.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (fc == null) {
- fc = new JFileChooser(new File(getProperties().getProperty("loadDir", "/usr/local/ndt/")));
- }
- int returnVal = fc.showOpenDialog(JAnalyze.this);
- getProperties().setProperty("loadDir", fc.getCurrentDirectory().getAbsolutePath());
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- try {
- File file = fc.getSelectedFile();
- JFrame loadingFrame = new LoadingFrame(file.getAbsolutePath(), JAnalyze.this);
- loadingFrame.setSize(150, 100);
- loadingFrame.setVisible(true);
- }
- catch (Exception exc) {
- System.out.println("Loading of the web100srv.log failed!");
- exc.printStackTrace();
- }
- }
- }
- });
- fileMenu.add(loadMenuItem);
- loadDBMenuItem.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JFrame loadingFrame = new LoadingDBFrame(JAnalyze.this);
- loadingFrame.setSize(150, 100);
- loadingFrame.setVisible(true);
- }
- });
- fileMenu.add(loadDBMenuItem);
- fileMenu.addSeparator();
- exitMenuItem.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- try {
- properties.store(new FileOutputStream(propertyFile), "JAnalyze properties file");
- }
- catch (FileNotFoundException e) {
- // do nothing
- }
- catch (IOException e) {
- // do nothing
- }
- System.exit(0);
- }
- });
- fileMenu.add(exitMenuItem);
- menuBar.add(fileMenu);
-
- filterMenuItem.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- filterFrame.setVisible(true);
- }
- });
- optionsMenu.add(filterMenuItem);
- dbConfMenuItem.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- dbConfFrame.setVisible(true);
- }
- });
- optionsMenu.add(dbConfMenuItem);
- snaplogMenuItem.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- snaplogFrame.setVisible(true);
- }
- });
- optionsMenu.add(snaplogMenuItem);
-
- menuBar.add(optionsMenu);
-
- viewSnaplogMenuItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JFileChooser chooser = new JFileChooser(new File(snaplogFrame.getSnaplogs()));
- int returnVal = chooser.showOpenDialog(JAnalyze.this);
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = chooser.getSelectedFile();
- String snaplogData = getSnaplogData(file.getAbsolutePath(), null, 0, false);
- JTextArea area = new JTextArea(snaplogData);
- area.setEditable(false);
- JFrame frame = new JFrame("Snaplog variables");
- frame.getContentPane().add(new JScrollPane(area), BorderLayout.CENTER);
- frame.setSize(800, 600);
- frame.setVisible(true);
- }
- }
- });
- snaplogsMenu.add(viewSnaplogMenuItem);
- plotSnaplogMenuItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JFileChooser chooser = new JFileChooser(new File(snaplogFrame.getSnaplogs()));
- int returnVal = chooser.showOpenDialog(JAnalyze.this);
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = chooser.getSelectedFile();
- plotSnaplog(file.getAbsolutePath());
- }
- }
- });
- snaplogsMenu.add(plotSnaplogMenuItem);
- plotSnaplogCWNDMenuItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JFileChooser chooser = new JFileChooser(new File(snaplogFrame.getSnaplogs()));
- int returnVal = chooser.showOpenDialog(JAnalyze.this);
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = chooser.getSelectedFile();
- plotSnaplogCWND(file.getAbsolutePath());
- }
- }
- });
- snaplogsMenu.add(plotSnaplogCWNDMenuItem);
- actionsMenu.add(snaplogsMenu);
- viewTcpdumpMenuItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JFileChooser chooser = new JFileChooser(new File(snaplogFrame.getSnaplogs()));
- int returnVal = chooser.showOpenDialog(JAnalyze.this);
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = chooser.getSelectedFile();
- String tcpdumpData = getTcpdumpData(file.getAbsolutePath());
- JTextArea area = new JTextArea(tcpdumpData);
- area.setEditable(false);
- JFrame frame = new JFrame("tcpdump trace");
- frame.getContentPane().add(new JScrollPane(area), BorderLayout.CENTER);
- frame.setSize(800, 600);
- frame.setVisible(true);
- }
- }
- });
- tcpdumpsMenu.add(viewTcpdumpMenuItem);
- plotTcpdumpMenuItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JFileChooser chooser = new JFileChooser(new File(snaplogFrame.getSnaplogs()));
- int returnVal = chooser.showOpenDialog(JAnalyze.this);
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = chooser.getSelectedFile();
- plotTcpdumpS(file.getAbsolutePath());
- }
- }
- });
- tcpdumpsMenu.add(plotTcpdumpMenuItem);
- actionsMenu.add(tcpdumpsMenu);
- viewCputimeMenuItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JFileChooser chooser = new JFileChooser(new File(snaplogFrame.getSnaplogs()));
- int returnVal = chooser.showOpenDialog(JAnalyze.this);
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = chooser.getSelectedFile();
- plotCputime(file.getAbsolutePath());
- }
- }
- });
- cputimesMenu.add(viewCputimeMenuItem);
- actionsMenu.add(cputimesMenu);
-
- menuBar.add(actionsMenu);
-
- setJMenuBar(menuBar);
-
- Container cp = getContentPane();
- cp.setLayout(new BorderLayout());
- listPanel.setLayout(new BorderLayout());
- cp.add(listPanel, BorderLayout.WEST);
- infoPanel.setLayout(new BorderLayout());
- cp.add(infoPanel);
-
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- setSize(900, 770);
- setVisible(true);
- }
-
- protected void loadDB(LoadingDBFrame frame) throws SQLException
- {
- stopLoading = false;
- try {
- Class.forName (dbConfFrame.getDriver()).newInstance ();
- }
- catch (Exception e) {
- System.out.println("Failed to load mysql jdbc driver: " + e.getMessage());
- }
- Connection con = DriverManager.getConnection(dbConfFrame.getDSN(),
- dbConfFrame.getUID(), dbConfFrame.getPWD());
-
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT * FROM ndt_test_results;");
- Collection<ResultsContainer> newResults = new Vector<ResultsContainer>();
- while (!stopLoading && rs.next()) {
- ResultsContainer result = new ResultsContainer(this);
- try {
- result.parseDBRow(rs);
- }
- catch (SQLException e) {
- continue;
- }
- result.calculate();
- newResults.add(result);
- frame.loadedResult();
- }
- if (stopLoading) {
- return;
- }
- results.clear();
- results.addAll(newResults);
- filterFrame.resultsChange();
- rebuildResultsList();
- }
-
- protected void loadWeb100srvLog(String filename, LoadingFrame frame) throws FileNotFoundException, IOException
- {
- stopLoading = false;
-// System.out.println("Loading file: " + filename);
- BufferedReader br = new BufferedReader(new FileReader(filename));
- String line;
- ResultsContainer result = new ResultsContainer(this);
- Collection<ResultsContainer> newResults = new Vector<ResultsContainer>();
- while (!stopLoading && (line = br.readLine()) != null) {
- if (line.startsWith("spds")) {
- result.parseSpds(line);
- continue;
- }
- if (line.startsWith("Running")) {
- result.parseRunAvg(line);
- continue;
- }
- if (line.startsWith("snaplog file:")) {
- result.parseSnaplogFilename(line);
- continue;
- }
- if (line.startsWith("c2s_snaplog file:")) {
- result.parseC2sSnaplogFilename(line);
- continue;
- }
- if (line.startsWith("cputime trace file:")) {
- result.parseCputimeFilename(line);
- continue;
- }
- if (line.contains("port")) {
- result = new ResultsContainer(this);
- result.parsePort(line);
- continue;
- }
- if (line.contains(",")) {
- if ((result != null) && result.parseWeb100Var(line)) {
- result.calculate();
- newResults.add(result);
- result = null;
- frame.loadedResult();
- }
- }
- }
- if (stopLoading) {
- return;
- }
- results.clear();
- results.addAll(newResults);
- filterFrame.resultsChange();
- rebuildResultsList();
- }
-
- protected String getSnaplogData(String snaplogFilename, String variables, int numOfLines, boolean trim) {
- if (snaplogFilename == null) {
- return "";
- }
- String[] cmdarray = new String[] {snaplogFrame.getGenplot(), "-tm", variables == null ?
- snaplogFrame.getVariables() : variables,
- snaplogFilename.startsWith("/") ? snaplogFilename :
- snaplogFrame.getSnaplogs().endsWith("/") ?
- snaplogFrame.getSnaplogs() + snaplogFilename :
- snaplogFrame.getSnaplogs() + "/" + snaplogFilename};
- Process genplotProcess;
- try {
- genplotProcess = Runtime.getRuntime().exec(cmdarray);
- }
- catch (IOException e) {
- System.out.println(e);
- return null;
- }
- BufferedReader in = new BufferedReader(new InputStreamReader(genplotProcess.getInputStream()));
- StringBuffer toReturn = new StringBuffer();
- try {
- int counter = 1;
- if (trim) {
- in.readLine();in.readLine();in.readLine();
- }
- String line = in.readLine();
- while (line != null && counter != numOfLines) {
- toReturn.append(line + "\n");
- line = in.readLine();
- counter += 1;
- }
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- genplotProcess.destroy();
- return toReturn.toString();
- }
-
- protected boolean checkTcpDump(String ndttraceFilename) {
- File file = new File(snaplogFrame.getSnaplogs(), ndttraceFilename);
- return file.exists() && file.canRead();
- }
-
- protected String getTcpdumpData(String ndttraceFilename) {
- if (ndttraceFilename == null) {
- return "";
- }
- String[] cmdarray = new String[] {snaplogFrame.getTcptrace(), "-l",
- ndttraceFilename.startsWith("/") ? ndttraceFilename :
- snaplogFrame.getSnaplogs().endsWith("/") ?
- snaplogFrame.getSnaplogs() + ndttraceFilename :
- snaplogFrame.getSnaplogs() + "/" + ndttraceFilename};
- Process tcptraceProcess;
- try {
- tcptraceProcess = Runtime.getRuntime().exec(cmdarray);
- }
- catch (IOException e) {
- System.out.println(e);
- return null;
- }
- BufferedReader in = new BufferedReader(new InputStreamReader(tcptraceProcess.getInputStream()));
- StringBuffer toReturn = new StringBuffer();
- try {
- String line = in.readLine();
- while (line != null) {
- toReturn.append(line + "\n");
- line = in.readLine();
- }
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- tcptraceProcess.destroy();
- return toReturn.toString();
-
- }
-
- protected void plotTcpdumpS(String ndttraceFilename) {
- if (ndttraceFilename == null) {
- return;
- }
- String[] cmdarray = new String[] {snaplogFrame.getTcptrace(), "-S",
- ndttraceFilename.startsWith("/") ? ndttraceFilename :
- snaplogFrame.getSnaplogs().endsWith("/") ?
- snaplogFrame.getSnaplogs() + ndttraceFilename :
- snaplogFrame.getSnaplogs() + "/" + ndttraceFilename};
- String[] cmdarray2 = new String[] {snaplogFrame.getXplot(), "a2b_tsg.xpl"};
- String[] cmdarray3 = new String[] {snaplogFrame.getXplot(), "b2a_tsg.xpl"};
- try {
- Runtime.getRuntime().exec(cmdarray);
- Thread.sleep(1000);
- Runtime.getRuntime().exec(cmdarray2);
- Runtime.getRuntime().exec(cmdarray3);
- }
- catch (InterruptedException e) {
- System.out.println(e);
- }
- catch (IOException e) {
- System.out.println(e);
- }
- }
-
-
- protected void plotSnaplog(String snaplogFilename) {
- if (snaplogFilename == null) {
- return;
- }
- String[] cmdarray = new String[] {snaplogFrame.getGenplot(), "-m", snaplogFrame.getVariables(),
- snaplogFilename.startsWith("/") ? snaplogFilename :
- snaplogFrame.getSnaplogs().endsWith("/") ?
- snaplogFrame.getSnaplogs() + snaplogFilename :
- snaplogFrame.getSnaplogs() + "/" + snaplogFilename};
- String[] cmdarray2 = new String[] {snaplogFrame.getXplot(),
- "User Defined" +
- (snaplogFilename.substring(snaplogFilename.lastIndexOf(".")).length() > 6 ?
- snaplogFilename.substring(
- snaplogFilename.substring(0, snaplogFilename.lastIndexOf(".")).lastIndexOf("."),
- snaplogFilename.lastIndexOf(".")) :
- snaplogFilename.substring(snaplogFilename.lastIndexOf("."))) + ".xpl"};
- try {
- Runtime.getRuntime().exec(cmdarray);
- Thread.sleep(1000);
- Runtime.getRuntime().exec(cmdarray2);
- }
- catch (InterruptedException e) {
- System.out.println(e);
- }
- catch (IOException e) {
- System.out.println(e);
- }
- }
-
- protected void plotSnaplogCWND(String snaplogFilename) {
- if (snaplogFilename == null) {
- return;
- }
- String[] cmdarray = new String[] {snaplogFrame.getGenplot(), "-C",
- snaplogFilename.startsWith("/") ? snaplogFilename :
- snaplogFrame.getSnaplogs().endsWith("/") ?
- snaplogFrame.getSnaplogs() + snaplogFilename :
- snaplogFrame.getSnaplogs() + "/" + snaplogFilename};
- String[] cmdarray2 = new String[] {snaplogFrame.getXplot(),
- "CurCwnd" +
- (snaplogFilename.substring(snaplogFilename.lastIndexOf(".")).length() > 6 ?
- snaplogFilename.substring(
- snaplogFilename.substring(0, snaplogFilename.lastIndexOf(".")).lastIndexOf("."),
- snaplogFilename.lastIndexOf(".")) :
- snaplogFilename.substring(snaplogFilename.lastIndexOf("."))) + ".xpl"};
- try {
- Runtime.getRuntime().exec(cmdarray);
- Thread.sleep(1000);
- Runtime.getRuntime().exec(cmdarray2);
- }
- catch (InterruptedException e) {
- System.out.println(e);
- }
- catch (IOException e) {
- System.out.println(e);
- }
- }
-
- protected void plotCputime(String cputraceFilename) {
- if (cputraceFilename == null) {
- return;
- }
- String fileName = cputraceFilename.startsWith("/") ? cputraceFilename :
- snaplogFrame.getSnaplogs().endsWith("/") ?
- snaplogFrame.getSnaplogs() + cputraceFilename :
- snaplogFrame.getSnaplogs() + "/" + cputraceFilename;
- JFileChooser chooser = new JFileChooser(new File(snaplogFrame.getSnaplogs()));
- BufferedReader br = null;
- try {
- br = new BufferedReader(new FileReader(fileName));
- }
- catch (FileNotFoundException exc) {
- int returnVal = chooser.showOpenDialog(JAnalyze.this);
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = chooser.getSelectedFile();
- try {
- br = new BufferedReader(new FileReader(file.getAbsolutePath()));
- }
- catch (Exception ex) {
- System.out.println("Loading of the cputime file: " + file.getAbsolutePath() + " failed!");
- ex.printStackTrace();
- return;
- }
- }
- else {
- return;
- }
- }
- String line;
- Vector<Double> time = new Vector<Double>();
- Vector<Double> userTime = new Vector<Double>();
- Vector<Double> systemTime = new Vector<Double>();
- Vector<Double> cuserTime = new Vector<Double>();
- Vector<Double> csystemTime = new Vector<Double>();
- try {
- while ((line = br.readLine()) != null) {
- StringTokenizer st = new StringTokenizer(line.trim(), " ");
- time.add(Double.parseDouble(st.nextToken()));
- userTime.add(Double.parseDouble(st.nextToken()));
- systemTime.add(Double.parseDouble(st.nextToken()));
- cuserTime.add(Double.parseDouble(st.nextToken()));
- csystemTime.add(Double.parseDouble(st.nextToken()));
- }
- br.close();
- }
- catch (IOException exc) {
- exc.printStackTrace();
- return;
- }
- double[][] model = new double[4][time.size()];
- double[] columns = new double[time.size()];
- for (int i = 0; i < time.size(); ++i) {
- model[0][i] = userTime.elementAt(i);
- model[1][i] = systemTime.elementAt(i);
- model[2][i] = cuserTime.elementAt(i);
- model[3][i] = csystemTime.elementAt(i);
- columns[i] = time.elementAt(i);
- }
- String[] rows = { "user time", "system time",
- "user time of dead children", "system time of dead children" };
- String title = "Cputime usage: " + cputraceFilename;
- EditableChartDataModel data = new EditableChartDataModel(model, columns, rows);
- ChartPanel panel = new ChartPanel(data, title, DefaultChart.LINEAR_X_LINEAR_Y);
- panel.addChartRenderer(new LineChartRenderer(panel.getCoordSystem(), data), 1);
-
- JFrame frame = new JFrame(title);
- frame.getContentPane().add(panel, BorderLayout.CENTER);
- frame.setSize(800, 600);
- frame.setVisible(true);
- }
-
-
- void rebuildResultsList() {
- listPanel.removeAll();
- infoPanel.removeAll();
- fillListPanel();
- }
-
- private void fillListPanel() {
- final JList list;
- list = new JList(new ResultsList(filterFrame.getResults()));
- list.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- list.addMouseListener(new
- MouseAdapter() {
-
- public void mousePressed(MouseEvent e) {
- int index = list.locationToIndex(e.getPoint());
- list.setSelectedIndex(index);
- }
-
- public void mouseReleased(MouseEvent e) {
- int index = list.locationToIndex(e.getPoint());
- list.setSelectedIndex(index);
- }
- });
- list.addListSelectionListener(new
- ListSelectionListener() {
-
- public void valueChanged(ListSelectionEvent arg0) {
- showResultInfo((ResultsContainer)
list.getSelectedValue());
- }
-
- private void showResultInfo(ResultsContainer result) {
- infoPanel.removeAll();
- infoPanel.add(result.getInfoPane());
- infoPanel.revalidate();
- }
- });
- JPanel tmpPanel = new JPanel();
- tmpPanel.add(new JLabel("Shown results: " + list.getModel().getSize() + "/" + results.size()));
- listPanel.add(tmpPanel, BorderLayout.NORTH);
- listPanel.add(new JScrollPane(list));
- listPanel.revalidate();
- listPanel.repaint();
- infoPanel.revalidate();
- infoPanel.repaint();
- }
-
- public static void main(String args[])
- {
- try {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (Exception ex) { ex.printStackTrace(); }
- new JAnalyze();
- }
-
- public void stopLoading() {
- stopLoading = true;
- }
-
- public Properties getProperties() {
- return properties;
- }
-}
=======================================
--- /trunk/janalyze/src/LoadingDBFrame.java Tue Nov 13 19:16:15 2007 UTC
+++ /dev/null
@@ -1,66 +0,0 @@
-import java.awt.Container;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-//import javax.swing.JProgressBar;
-import javax.swing.WindowConstants;
-
-public class LoadingDBFrame extends JFrame {
-
- private static final long serialVersionUID = 1L;
-
- private JButton cancelButton = new JButton("Cancel");
-// private JProgressBar progressBar;
- private int loaded = 0;
- private JLabel loadedLabel = new JLabel("Loaded results: " + loaded);
-
- public LoadingDBFrame(final JAnalyze janalyze) {
- super("Loading...");
-
- final SwingWorker worker = new SwingWorker() {
- public Object construct() {
- try {
- janalyze.loadDB(LoadingDBFrame.this);
- }
- catch (Exception exc) {
- System.out.println("Loading of the DB data failed!");
- exc.printStackTrace();
- }
- return null;
- }
- public void finished() {
- LoadingDBFrame.this.setVisible(false);
- LoadingDBFrame.this.dispose();
- }
- };
-
-// progressBar = new JProgressBar();
-// progressBar.setStringPainted(true);
- Container cp = getContentPane();
- cp.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)) ;
- cp.add(loadedLabel);
-// cp.add(progressBar);
- cp.add(cancelButton);
-
- cancelButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- worker.interrupt();
- janalyze.stopLoading();
- LoadingDBFrame.this.setVisible(false);
- LoadingDBFrame.this.dispose();
- }
- });
-
- setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- worker.start();
- }
-
- public void loadedResult() {
- loaded++;
- loadedLabel.setText("Loaded results: " + loaded);
- }
-}
=======================================
--- /trunk/janalyze/src/LoadingFrame.java Tue Nov 13 19:16:15 2007 UTC
+++ /dev/null
@@ -1,66 +0,0 @@
-import java.awt.Container;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-//import javax.swing.JProgressBar;
-import javax.swing.WindowConstants;
-
-public class LoadingFrame extends JFrame {
-
- private static final long serialVersionUID = 1L;
-
- private JButton cancelButton = new JButton("Cancel");
-// private JProgressBar progressBar;
- private int loaded = 0;
- private JLabel loadedLabel = new JLabel("Loaded results: " + loaded);
-
- public LoadingFrame(final String filename, final JAnalyze janalyze) {
- super("Loading...");
-
- final SwingWorker worker = new SwingWorker() {
- public Object construct() {
- try {
- janalyze.loadWeb100srvLog(filename,
LoadingFrame.this);
- }
- catch (Exception exc) {
- System.out.println("Loading of the web100srv.log failed!");
- exc.printStackTrace();
- }
- return null;
- }
- public void finished() {
- LoadingFrame.this.setVisible(false);
- LoadingFrame.this.dispose();
- }
- };
-
-// progressBar = new JProgressBar();
-// progressBar.setStringPainted(true);
- Container cp = getContentPane();
- cp.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)) ;
- cp.add(loadedLabel);
-// cp.add(progressBar);
- cp.add(cancelButton);
-
- cancelButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- worker.interrupt();
- janalyze.stopLoading();
- LoadingFrame.this.setVisible(false);
- LoadingFrame.this.dispose();
- }
- });
-
- setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- worker.start();
- }
-
- public void loadedResult() {
- loaded++;
- loadedLabel.setText("Loaded results: " + loaded);
- }
-}
=======================================
--- /trunk/janalyze/src/MaxPeakInfo.java Tue Nov 13 19:16:15 2007 UTC
+++ /dev/null
@@ -1,9 +0,0 @@
-class MaxPeakInfo extends PeakInfo {
- MaxPeakInfo(int cwnd, int sampleRTT) {
- super(cwnd, sampleRTT);
- }
-
- public String toString() {
- return "max: " + super.toString();
- }
-}
=======================================
--- /trunk/janalyze/src/MinPeakInfo.java Tue Nov 13 19:16:15 2007 UTC
+++ /dev/null
@@ -1,9 +0,0 @@
-class MinPeakInfo extends PeakInfo {
- MinPeakInfo(int cwnd, int sampleRTT) {
- super(cwnd, sampleRTT);
- }
-
- public String toString() {
- return "min: " + super.toString();
- }
-}
=======================================
--- /trunk/janalyze/src/PeakInfo.java Tue Nov 13 19:16:15 2007 UTC
+++ /dev/null
@@ -1,40 +0,0 @@
-class PeakInfo {
- private int cwnd;
- private int sampleRTT;
-
- PeakInfo(int cwnd, int sampleRTT) {
- this.cwnd = cwnd;
- this.sampleRTT = sampleRTT;
- }
-
- int getCwnd() {
- return cwnd;
- }
-
- int getSampleRTT() {
- return sampleRTT;
- }
-
- public String toString() {
- return "Cwnd = " + cwnd + ", sampleRTT = " + sampleRTT + ", " + getPeakSpeed(cwnd, sampleRTT);
- }
-
- public static String getPeakSpeed(int cwnd, int sampleRTT) {
- double pSpeed = (cwnd * 8.0) / sampleRTT;
- if (pSpeed < 1000.0) {
- return "peak speed = " + Helpers.formatDouble(pSpeed, 4) + " kbps";
- }
- else if (pSpeed < 1000000.0) {
- return "peak speed = " + Helpers.formatDouble(pSpeed / 1000.0, 4) + " Mbps";
- }
- else {
- return "peak speed = " + Helpers.formatDouble(pSpeed / 1000000.0, 4) + " Gbps";
- }
-
- }
-
- public static double getPeakSpeedInMbps(int cwnd, int sampleRTT) {
- double pSpeed = (cwnd * 8.0) / sampleRTT;
- return pSpeed / 1000.0;
- }
-}
=======================================
--- /trunk/janalyze/src/PropertyListener.java Tue Nov 13 19:16:15 2007 UTC
+++ /dev/null
@@ -1,33 +0,0 @@
-import javax.swing.event.DocumentListener;
-import javax.swing.event.DocumentEvent;
-import javax.swing.text.BadLocationException;
-
-public class PropertyListener implements DocumentListener {
- private JAnalyze mainWindow;
- private String property;
-
- public PropertyListener(JAnalyze mainWindow, String property) {
- this.mainWindow = mainWindow;
- this.property = property;
- }
-
- private void updateProperty(DocumentEvent e) {
- try {
- mainWindow.getProperties().setProperty(property,
- e.getDocument().getText(0, e.getDocument().getLength()));
- }
- catch (BadLocationException exc) {
- // do nothing
- }
- }
-
- public void changedUpdate(DocumentEvent e) {
- updateProperty(e);
- }
- public void insertUpdate(DocumentEvent e) {
- updateProperty(e);
- }
- public void removeUpdate(DocumentEvent e) {
- updateProperty(e);
- }
-}
=======================================
--- /trunk/janalyze/src/ResultsContainer.java Thu Nov 15 21:17:15 2007 UTC
+++ /dev/null
@@ -1,1095 +0,0 @@
-import java.awt.Component;
-import java.awt.Color;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-import java.util.Collection;
-import java.util.StringTokenizer;
-import java.util.Vector;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import java.awt.BorderLayout;
-import javax.swing.JFrame;
-import javax.swing.JScrollPane;
-import javax.swing.JButton;
-import javax.swing.JTextArea;
-import javax.swing.text.StyleConstants;
-import javax.swing.text.SimpleAttributeSet;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-public class ResultsContainer {
- private JAnalyze mainWindow;
- private double[] run_ave = new double[4];
- private double[] runave = new double[4];
- private int[][] links = new int[4][16];
- private int n = 0, m = 0, port;
- private String date, ip_addr, btlneck, cputraceFilename, snaplogFilename,
- c2sSnaplogFilename, ndttraceFilename;
- private int s2c2spd, s2cspd, c2sspd;
- private int timeouts, sumRTT, countRTT, pktsRetrans, fastRetrans,
- dataPktsOut, ackPktsOut, currentMSS, dupAcksIn, ackPktsIn,
- maxRwinRcvd, sndBuf, currentCwnd, sndLimTimeRwin, sndLimTimeCwnd,
- sndLimTimeSender, dataBytesOut, sndLimTransRwin, sndLimTransCwnd,
- sndLimTransSender, maxSsthresh, currentRTO, currentRwinRcvd, link,
- mismatch, bad_cable, half_duplex, c2sdata, c2sack,
- s2cdata, s2cack, pktsOut;
- private int congestionSignals = -1, minRTT = -1, congAvoid = -1,
- congestionOverCount = 0, maxRTT = 0, slowStart = 0, totaltime;
- private int linkcnt, mismatch2, mismatch3;
- private double idle, loss, loss2, order, bw, bw2;
- private double rwintime, cwndtime, sendtime, timesec;
- private double recvbwd, cwndbwd, sendbwd;
- private int congestion2=0;
- private double acks, aspeed, avgrtt;
- private double cong, retrn, increase, touts, fr_ratio = 0;
- private double retransec, mmorder;
- private int[] tail = new int[4];
- private int[] head = new int[4];
-
- /* --- experimental congestion detection code --- */
- double linkType, sspd, mspd;
- double minrtt, ispd, n1, T1, lspd, n2, T2, lT2, uT2, teeth, lTeeth, uTeeth;
- boolean limited, normalOperation;
- private int minPeak = -1, maxPeak = -1, peaks = -1, rawPeaks = -1, realTeeth, ssCurCwnd = -1,
- ssSampleRTT = -1, fSampleRTT = -1, initPeakSpeed = -1;
- private Collection<PeakInfo> peakInfos = new Vector<PeakInfo>();
- private MaxPeakInfo maxPeakSpeed = null;
- private MinPeakInfo minPeakSpeed = null;
- private int max25 = -1, max50 = -1, max75 = -1, maxJitter = -1;
- private int min25 = -1, min50 = -1, min75 = -1, minJitter = -1;
- /* ---------------------------------------------- */
-
- ResultsContainer(JAnalyze mainWindow) {
- this.mainWindow = mainWindow;
- }
-
- public void parseDBRow(ResultSet rs) throws SQLException {
- subParseSpds(rs.getString("spds1"));
- subParseSpds(rs.getString("spds2"));
- subParseSpds(rs.getString("spds3"));
- subParseSpds(rs.getString("spds4"));
- run_ave[0] = rs.getFloat("runave1");
- run_ave[1] = rs.getFloat("runave2");
- run_ave[2] = rs.getFloat("runave3");
- run_ave[3] = rs.getFloat("runave4");
- cputraceFilename = rs.getString("cputimelog");
- if (cputraceFilename.length() == 0)
- cputraceFilename = null;
- snaplogFilename = rs.getString("snaplog");
- if (snaplogFilename.length() == 0)
- snaplogFilename = null;
- c2sSnaplogFilename = rs.getString("c2s_snaplog");
- if (c2sSnaplogFilename.length() == 0)
- c2sSnaplogFilename = null;
- ip_addr = rs.getString("hostName");
- port = rs.getInt("testPort");
- date = rs.getString("date");
- s2c2spd = rs.getInt("s2c2spd");
- s2cspd = rs.getInt("s2cspd");
- c2sspd = rs.getInt("c2sspd");
- timeouts = rs.getInt("Timeouts");
- sumRTT = rs.getInt("SumRTT");
- countRTT = rs.getInt("CountRTT");
- pktsRetrans = rs.getInt("PktsRetrans");
- fastRetrans = rs.getInt("FastRetran");
- dataPktsOut = rs.getInt("DataPktsOut");
- ackPktsOut = rs.getInt("AckPktsOut");
- currentMSS = rs.getInt("CurrentMSS");
- dupAcksIn = rs.getInt("DupAcksIn");
- ackPktsIn = rs.getInt("AckPktsIn");
- maxRwinRcvd = rs.getInt("MaxRwinRcvd");
- sndBuf = rs.getInt("Sndbuf");
- currentCwnd = rs.getInt("MaxCwnd");
- sndLimTimeRwin = rs.getInt("SndLimTimeRwin");
- sndLimTimeCwnd = rs.getInt("SndLimTimeCwnd");
- sndLimTimeSender = rs.getInt("SndLimTimeSender");
- dataBytesOut = rs.getInt("DataBytesOut");
- sndLimTransRwin = rs.getInt("SndLimTransRwin");
- sndLimTransCwnd = rs.getInt("SndLimTransCwnd");
- sndLimTransSender = rs.getInt("SndLimTransSender");
- maxSsthresh = rs.getInt("MaxSsthresh");
- currentRTO = rs.getInt("CurrentRTO");
- currentRwinRcvd = rs.getInt("CurrentRwinRcvd");
- link = rs.getInt("link");
- mismatch = rs.getInt("mismatch");
- bad_cable = rs.getInt("bad_cable");
- half_duplex = rs.getInt("half_duplex");
- c2sdata = rs.getInt("c2sdata");
- c2sack = rs.getInt("c2sack");
- s2cdata = rs.getInt("s2cdata");
- s2cack = rs.getInt("s2cack");
- congestionSignals = rs.getInt("CongestionSignals");
- pktsOut = rs.getInt("PktsOut");
- minRTT = rs.getInt("MinRTT");
- congAvoid = rs.getInt("CongAvoid");
- congestionOverCount = rs.getInt("CongestionOverCount");
- maxRTT = rs.getInt("MaxRTT");
- slowStart = rs.getInt("SlowStart");
- minPeak = rs.getInt("minPeak");
- maxPeak = rs.getInt("maxPeak");
- peaks = rs.getInt("peaks");
- /*ip_addr2 = rs.getString("rmt_host");*/
- /*congestion = rs.getInt("congestion");*/
- /*rcvWinScale = rs.getInt("RcvWinScale");*/
- /*autotune = rs.getInt("autotune");*/
- /*otherReductions = rs.getInt("OtherReductions");*/
- /*curTimeouts = rs.getInt("CurTimeoutCount");*/
- /*abruptTimeouts = rs.getInt("AbruptTimeouts");*/
- /*sendStall = rs.getInt("SendStall");*/
- /*subsequentTimeouts = rs.getInt("SubsequentTimeouts");*/
- /*thruBytesAcked = rs.getInt("ThruBytesAcked");*/
- }
-
- private void subParseSpds(String line) {
- StringTokenizer st = new StringTokenizer(line, " ");
- linkcnt = 0;
- while (st.hasMoreTokens()) {
- String number = st.nextToken();
- try {
- links[n][linkcnt] = Integer.parseInt(number);
- linkcnt++;
- }
- catch (NumberFormatException exc) {
- runave[n] = Double.parseDouble(number);
- linkcnt++;
- break;
- }
- }
- n++;
-
- }
-
- public void parseSpds(String line) {
- String spdsLine = line.substring(line.indexOf("'") + 1, line.lastIndexOf("'"));
- subParseSpds(spdsLine.trim());
- }
-
- public void parseRunAvg(String line) {
- StringTokenizer st = new StringTokenizer(line.trim(), " ");
- st.nextToken(); st.nextToken(); st.nextToken();
- run_ave[m] = Double.parseDouble(st.nextToken());
- m++;
- }
-
- public void parsePort(String line) {
- // System.out.println("Start of New Packet trace -- " +
line);
- String dateAndHost = line.substring(0, line.indexOf("port") - 1);
- date = dateAndHost.substring(0, dateAndHost.lastIndexOf(" ")).trim();
- ip_addr = dateAndHost.substring(dateAndHost.lastIndexOf(" ")).trim();
- port = Integer.parseInt(line.substring(line.indexOf("port") + 5));
- }
-
- public void parseSnaplogFilename(String line) {
- snaplogFilename = line.substring(14);
- }
-
- public void parseC2sSnaplogFilename(String line) {
- c2sSnaplogFilename = line.substring(18);
- }
-
- public void parseCputimeFilename(String line) {
- cputraceFilename = line.substring(20);
- }
-
- public boolean parseWeb100Var(String line) {
- StringTokenizer st = new StringTokenizer(line.trim(), ",");
- st.nextToken();
- /* ip_addr2 */ st.nextToken();
- if (st.hasMoreTokens() == false) {
- return false;
- }
- try {
- s2c2spd = Integer.parseInt(st.nextToken());
- s2cspd = Integer.parseInt(st.nextToken());
- c2sspd = Integer.parseInt(st.nextToken());
- timeouts = Integer.parseInt(st.nextToken());
- sumRTT = Integer.parseInt(st.nextToken());
- countRTT = Integer.parseInt(st.nextToken());
- pktsRetrans = Integer.parseInt(st.nextToken());
- fastRetrans = Integer.parseInt(st.nextToken());
- dataPktsOut = Integer.parseInt(st.nextToken());
- ackPktsOut = Integer.parseInt(st.nextToken());
- currentMSS = Integer.parseInt(st.nextToken());
- dupAcksIn = Integer.parseInt(st.nextToken());
- ackPktsIn = Integer.parseInt(st.nextToken());
- maxRwinRcvd = Integer.parseInt(st.nextToken());
- sndBuf = Integer.parseInt(st.nextToken());
- currentCwnd = Integer.parseInt(st.nextToken());
- sndLimTimeRwin = Integer.parseInt(st.nextToken());
- sndLimTimeCwnd = Integer.parseInt(st.nextToken());
- sndLimTimeSender = Integer.parseInt(st.nextToken());
- dataBytesOut = Integer.parseInt(st.nextToken());
- sndLimTransRwin = Integer.parseInt(st.nextToken());
- sndLimTransCwnd = Integer.parseInt(st.nextToken());
- sndLimTransSender = Integer.parseInt(st.nextToken());
- maxSsthresh = Integer.parseInt(st.nextToken());
- currentRTO = Integer.parseInt(st.nextToken());
- currentRwinRcvd = Integer.parseInt(st.nextToken());
- link = Integer.parseInt(st.nextToken());
- mismatch = Integer.parseInt(st.nextToken());
- bad_cable = Integer.parseInt(st.nextToken());
- half_duplex = Integer.parseInt(st.nextToken());
- /* congestion */ Integer.parseInt(st.nextToken());
- c2sdata = Integer.parseInt(st.nextToken());
- c2sack = Integer.parseInt(st.nextToken());
- s2cdata = Integer.parseInt(st.nextToken());
- s2cack = Integer.parseInt(st.nextToken());
- congestionSignals = Integer.parseInt(st.nextToken());
- pktsOut = Integer.parseInt(st.nextToken());
- minRTT = Integer.parseInt(st.nextToken());
- /* rcvWinScale */ Integer.parseInt(st.nextToken());
- /* autotune */ Integer.parseInt(st.nextToken());
- congAvoid = Integer.parseInt(st.nextToken());
- congestionOverCount = Integer.parseInt(st.nextToken());
- maxRTT = Integer.parseInt(st.nextToken());
- /* otherReductions */ Integer.parseInt(st.nextToken());
- /* curTimeouts */ Integer.parseInt(st.nextToken());
- /* abruptTimeouts */ Integer.parseInt(st.nextToken());
- /* sendStall */ Integer.parseInt(st.nextToken());
- slowStart = Integer.parseInt(st.nextToken());
- /* subsequentTimeouts */ Integer.parseInt(st.nextToken());
- /* thruBytesAcked */ Integer.parseInt(st.nextToken());
- minPeak = Integer.parseInt(st.nextToken());
- maxPeak = Integer.parseInt(st.nextToken());
- peaks = Integer.parseInt(st.nextToken());
- }
- catch (Exception exc) {
- // do nothing
- }
- return true;
- }
-
- public void calculate() {
- int i, j;
- double k, rttsec, spd;
-
- tail[0] = tail[1] = tail[2] = tail[3] = 0;
- head[0] = head[1] = head[2] = head[3] = 0;
-
- for (i=0; i<4; i++) {
- int max = 0;
- int indx = 0;
- int total = 0;
- for (j=0; j<linkcnt-1; j++) {
- total += links[i][j];
- if (max < links[i][j]) {
- max = links[i][j];
- indx = j;
- }
- }
- for (j=indx+1; j<10; j++) {
- k = (float) links[i][j] / max;
- if (k > .1)
- tail[i]++;
- }
- for (j=0; j<indx; j++) {
- k = (float) links[i][j] / max;
- if (k > .1)
- head[i]++;
- }
- if (links[i][indx] == -1)
- indx = -1;
- if ((total < 20) && (indx != -1))
- indx = -2;
- switch (i) {
- case 0: c2sdata = indx;
- // System.out.println("Client --> Server data detects link = " + describeDetLink(indx));
- break;
- case 1: c2sack = indx;
- // System.out.println("Client <-- Server Ack's detect link = " + describeDetLink(indx));
- break;
- case 2: s2cdata = indx;
- // System.out.println("Server --> Client data detects link = " + describeDetLink(indx));
- break;
- case 3: s2cack = indx;
- // System.out.println("Server <-- Client Ack's detect link = " + describeDetLink(indx));
- break;
- }
- }
- switch (c2sdata) {
- case -2: btlneck = "Insufficent Data"; break;
- case -1: btlneck = "a System Fault"; break;
- case 0: btlneck = "the Round Trip Time"; break;
- case 1: btlneck = "a 'Dial-up modem' connection"; break;
- case 2:
- if ((c2sspd/s2cspd > .8) && (c2sspd/s2cspd < 1.2) && (c2sspd > 1000))
- btlneck = "a 'T1' subnet";
- else {
- if ((tail[3] > 1) || (s2cack == 3))
- btlneck = "a 'Cable Modem' connection";
- else
- btlneck = "a 'DSL' connection";
- }
- break;
- case 3: if (linkcnt == 16)
- btlneck = "a T1 + subnet";
- else
- btlneck = "an 'Ethernet' subnet";
- break;
- case 4: if (linkcnt == 16)
- btlneck = "a IEEE 802.11b Wifi subnet";
- else
- btlneck = "a 'T3/DS-3' subnet";
- break;
- case 5: if (linkcnt == 16)
- btlneck = "a Wifi + subnet";
- else
- btlneck = "a 'FastEthernet' subnet";
- break;
- case 6: if (linkcnt == 16)
- btlneck = "a Ethernet subnet";
- else
- btlneck = "an 'OC-12' subnet";
- break;
- case 7: if (linkcnt == 16)
- btlneck = "a T3/DS3 subnet";
- else
- btlneck = "a 'Gigabit Ethernet' subnet";
- break;
- case 8: if (linkcnt == 16)
- btlneck = "a FastEthernet subnet";
- else
- btlneck = "an 'OC-48' subnet";
- break;
- case 9: if (linkcnt == 16)
- btlneck = "a OC-12 subnet";
- else
- btlneck = "a '10 Gigabit Enet' subnet";
- break;
- case 10: if (linkcnt == 16)
- btlneck = "a Gigabit Ethernet subnet";
- else
- btlneck = "Retransmissions";
- case 11: btlneck = "an 'OC-48' subnet"; break;
- case 12: btlneck = "a '10 Gigabit Enet' subnet"; break;
- case 13: btlneck = "Retransmissions"; break;
- }
- /* Calculate some values */
- avgrtt = (double) sumRTT/countRTT;
- rttsec = avgrtt * .001;
- loss = (double)(pktsRetrans- fastRetrans)/(double)(dataPktsOut-ackPktsOut);
- loss2 = (double)congestionSignals/pktsOut;
- if (loss == 0)
- loss = .0000000001; /* set to 10^-6 for now */
- if (loss2 == 0)
- loss2 = .0000000001; /* set to 10^-6 for now */
-
- order = (double)dupAcksIn/ackPktsIn;
- bw = (currentMSS / (rttsec * Math.sqrt(loss))) * 8 / 1024 / 1024;
- bw2 = (currentMSS / (rttsec * Math.sqrt(loss2))) * 8 / 1024 / 1024;
- totaltime = sndLimTimeRwin + sndLimTimeCwnd + sndLimTimeSender;
- rwintime = (double)sndLimTimeRwin/totaltime;
- cwndtime = (double)sndLimTimeCwnd/totaltime;
- sendtime = (double)sndLimTimeSender/totaltime;
- timesec = totaltime/1000000;
- idle = (timeouts * ((double)currentRTO/1000))/timesec;
- retrn = (float)pktsRetrans / pktsOut;
- increase = (float)congAvoid / pktsOut;
-
- recvbwd = ((maxRwinRcvd*8)/avgrtt)/1000;
- cwndbwd = ((currentCwnd*8)/avgrtt)/1000;
- sendbwd = ((sndBuf*8)/avgrtt)/1000;
-
- spd = ((double)dataBytesOut / (double)totaltime) * 8;
-
- mismatch2 = 0;
- mismatch3 = 0;
- mmorder = (float)(dataPktsOut - pktsRetrans - fastRetrans) / dataPktsOut;
- cong = (float)(congestionSignals - congestionOverCount) / pktsOut;
- touts = (float)timeouts / pktsOut;
- if (pktsRetrans > 0)
- fr_ratio = fastRetrans / pktsRetrans;
- retransec = pktsRetrans / timesec;
-
- /* new test based on analysis of TCP behavior in duplex mismatch condition. */
-
- acks = (double) ackPktsIn / (double) dataPktsOut;
- if (s2cspd < c2sspd)
- aspeed = (double)c2sspd / (double)s2cspd;
- else
- aspeed = (double)s2cspd / (double)c2sspd;
-
- if (((acks > 0.7) || (acks < 0.3)) && (retrn > 0.03) && (congAvoid
slowStart)) {
- if ((2*currentMSS) == maxSsthresh) {
- mismatch2 = 1;
- mismatch3 = 0;
- } else if (aspeed > 15){
- mismatch2 = 2;
- }
- }
- if ((idle > 0.65) && (touts < 0.4)) {
- if (maxSsthresh == (2*currentMSS)) {
- mismatch2 = 0;
- mismatch3 = 1;
- } else {
- mismatch3 = 2;
- }
- }
- /* estimate is less than throughput, something is wrong */
- if (bw < spd)
- link = 0;
-
- if (((loss*100)/timesec > 15) && (cwndtime/timesec > .6) &&
- (loss < .01) && (maxSsthresh > 0))
- bad_cable = 1;
-
- /* test for Ethernet link (assume Fast E.) */
- if ((spd < 9.5) && (spd > 3.0) && (loss < .01) && (order < .035) && (link > 0))
- link = 10;
-
- /* test for DSL/Cable modem link */
- if ((sndLimTimeSender < 15000) && (spd < 2) && (spd < bw) && (link
0))
- link = 2;
-
- if (((rwintime > .95) && (sndLimTransRwin/timesec > 30) &&
- (sndLimTransSender/timesec > 30)) || (link <= 10))
- half_duplex = 1;
-
- if ((cwndtime > .02) && (mismatch2 == 0) && (cwndbwd < recvbwd))
- congestion2 = 1;
-
- // System.out.println("Throughput to host [" + ip_addr + "] is limited by " + btlneck);
-
- // System.out.println("\tWeb100 says link = " + link + ", speed-chk says link = " + c2sdata);
- // System.out.println("\tSpeed-chk says {" + c2sdata + ", " + c2sack + ", " + s2cdata + ", " + s2cack +
- // "}, Running average = {" + Helpers.formatDouble(runave[0], 1) + ", " + Helpers.formatDouble(runave[1], 1) +
- // ", " + Helpers.formatDouble(runave[2], 1) + ", " + Helpers.formatDouble(runave[3], 1) + "}");
- // if (c2sspd > 1000)
- // System.out.print("\tC2Sspeed = " + Helpers.formatDouble(c2sspd/1000.0, 2) + " Mbps, S2Cspeed = " +
- // Helpers.formatDouble(s2cspd/1000.0, 2) + " Mbps,\nCWND-Limited = " + Helpers.formatDouble(s2c2spd/1000.0, 2) + " Mbps, ");
- // else
- // System.out.print("\tC2Sspeed = " + c2sspd + " kbps, S2Cspeed = " + s2cspd + " kbps,\nCWND-Limited: " + s2c2spd + " kbps, ");
- // if (bw > 1)
- // System.out.println("Estimate = " + Helpers.formatDouble(bw, 2) + " Mbps (" + Helpers.formatDouble(bw2, 2) + " Mbps)");
- // else
- // System.out.println("Estimate = " + Helpers.formatDouble(bw*1000, 2) + " kbps (" +
- // Helpers.formatDouble(bw2*1000, 2) +
" kbps)");
- //
- // if ((bw*1000) > s2cspd)
- // System.out.print("\tOld estimate is greater than
measured; ");
- // else
- // System.out.print("\tOld estimate is less than
measured; ");
- //
- // if (congestionSignals == -1)
- // System.out.println("No data collected to calculage new estimate");
- // else {
- // if ((bw2*1000) > s2cspd)
- // System.out.println("New estimate is
greater than measured");
- // else
- // System.out.println("New estimate is less
than measured");
- // }
- // System.out.println("\tLoss = " + Helpers.formatDouble(loss*100, 2) + "% (" + Helpers.formatDouble(loss2*100, 2) +
- // "%), Out-of-Order = " +
Helpers.formatDouble(order*100, 2) +
- // "%, Long tail = {" + tail[0] + ", " + tail[1] + ", " + tail[2] + ", " + tail[3] + "}");
- // System.out.println("\tDistribution = {" + head[0] + ", " + head[1] + ", " + head[2] + ", " + head[3] +
- // "}, time spent {r=" + Helpers.formatDouble(rwintime*100, 1) + "% c=" + Helpers.formatDouble(cwndtime*100, 1) +
- // "% s=" + Helpers.formatDouble(sendtime*100, 1)
+ "%}");
- // System.out.println("\tAve(min) RTT = " + Helpers.formatDouble(avgrtt, 2) + " (" + minRTT +
- // ") msec, Buffers = {r=" + maxRwinRcvd + ", c=" + currentCwnd + ", s=" + sndBuf/2 + "}");
- // System.out.println("\tbw*delay = {r=" + Helpers.formatDouble(recvbwd, 2) + ", c=" +
- // Helpers.formatDouble(cwndbwd, 2) + ", s=" + Helpers.formatDouble(sendbwd, 2) +
- // "}, Transitions/sec = {r=" + Helpers.formatDouble(sndLimTransRwin/timesec, 1) + ", c=" +
- // Helpers.formatDouble(sndLimTransCwnd/timesec,
1) + ", s=" +
- // Helpers.formatDouble(sndLimTransSender/timesec,
1) + "}");
- // System.out.println("\tRetransmissions/sec = " + Helpers.formatDouble(pktsRetrans/timesec, 1) + ", Timeouts/sec = " + Helpers.formatDouble(timeouts/timesec, 1) + ", SSThreshold = " + maxSsthresh);
- // System.out.print("\tMismatch = " + mismatch + " (" + mismatch2 + ":" + mismatch3 + "[" + Helpers.formatDouble(mmorder, 2) + "])");
- // if (mismatch3 == 1)
- // System.out.print(" [H=F, S=H]");
- // if (mismatch2 == 1)
- // System.out.print(" [H=H, S=F]");
- // System.out.println(", Cable fault = " + bad_cable + ", Congestion = " + congestion2 +
- // ", Duplex = " + half_duplex + "\n");
-
- /* --- experimental congestion detection code --- */
-
- if (ssCurCwnd == -1) {
- String snaplogData = mainWindow.getSnaplogData(snaplogFilename, "CurCwnd,SampleRTT", 0, true);
- StringTokenizer st = new StringTokenizer(snaplogData);
- boolean slowStart = true;
- boolean decreasing = false;
- int prevCWNDval = -1;
- int prevSampleRTT = -1;
- int CurCwnd = -1;
- int CurSampleRTT = - 1;
- try {
- while (st.hasMoreTokens()) {
- st.nextToken(); st.nextToken();
- CurCwnd = Integer.parseInt(st.nextToken());
- CurSampleRTT = Integer.parseInt(st.nextToken());
- if (slowStart) {
- if (CurCwnd < prevCWNDval) {
- slowStart = false;
- maxPeak = prevCWNDval;
- minPeak = -1;
- peaks = 1;
- rawPeaks = 1;
- decreasing = true;
- peakInfos.add(new MaxPeakInfo(ssCurCwnd, ssSampleRTT == 0 ? 1 : ssSampleRTT));
- }
- else {
- ssCurCwnd = CurCwnd;
- ssSampleRTT = CurSampleRTT;
- if (ssSampleRTT > 0 && fSampleRTT == -1) {
- fSampleRTT = ssSampleRTT;
- }
- }
- }
- else {
- if (CurCwnd < prevCWNDval) {
- if (prevCWNDval > maxPeak) {
- maxPeak = prevCWNDval;
- }
- rawPeaks += 1;
- if (!decreasing) {
- // the max peak
- peakInfos.add(new MaxPeakInfo(prevCWNDval, prevSampleRTT == 0 ? 1 : prevSampleRTT));
- peaks += 1;
- }
- decreasing = true;
- }
- else if (CurCwnd > prevCWNDval) {
- if ((minPeak == -1) || (prevCWNDval < minPeak)) {
- minPeak = prevCWNDval;
- }
- if (decreasing) {
- // the min peak
- peakInfos.add(new MinPeakInfo(prevCWNDval, prevSampleRTT == 0 ? 1 : prevSampleRTT));
- }
- decreasing = false;
- }
- }
- prevCWNDval = CurCwnd;
- prevSampleRTT = CurSampleRTT;
- }
- }
- catch (Exception e) {
- // do nothing
- }
- }
-
- // 1) extract the bottleneck link type and the average & minimum RTT
- // values. (If min == 0 then set min = 1msec)
-
- linkType = decodeLinkSpeed(c2sdata) < 0 ? 1 : decodeLinkSpeed(c2sdata);
- minrtt = minRTT <= 0 ? 1 : minRTT;
-
- // 2) find the time required to overshoot link type
-
- sspd = linkType;
- ispd = (currentMSS * 8 / 1024.0) / avgrtt;
- n1 = Math.log(sspd/ispd) / Math.log(2);
- T1 = n1 * avgrtt;
-
- // 3) find the number of teeth (assume single loss on overshoot)
-
- mspd = linkType;
- lspd = mspd / 2.0;
- // ispd = currentMSS * 8 / avgrtt;
- n2 = lspd / ispd;
- T2 = n2 * avgrtt;
- lT2 = n2 * maxRTT;
- uT2 = n2 * fSampleRTT;
- teeth = (((totaltime / 1000) - T1) / T2) + 1;
- lTeeth = (((totaltime / 1000) - T1) / lT2) + 1;
- uTeeth = (((totaltime / 1000) - T1) / uT2) + 1;
-
- // 4) find out if the connection is buffer limited
-
- limited = false;
- if (currentRwinRcvd * 8 / avgrtt < linkType)
- limited = true;
-
- // 5)
-
- if (peaks != -1) {
- realTeeth = peaks;
- }
- else {
- realTeeth = congestionSignals;
- }
- if (Math.abs((realTeeth/teeth) - 1.0) < (0.05 + (1.0/teeth)) && !limited) {
- normalOperation = true;
- }
- else {
- normalOperation = false;
- }
-
- if (ssCurCwnd != -1) {
- initPeakSpeed = encodeLinkSpeed(PeakInfo.getPeakSpeedInMbps(ssCurCwnd, ssSampleRTT));
- }
-
- /* Statistical analysis */
-
- SortedSet<Integer> curMaxCwnds = new TreeSet<Integer>();
- SortedSet<Integer> curMinCwnds = new TreeSet<Integer>();
-
- for (PeakInfo peak : peakInfos) {
- if (peak instanceof MaxPeakInfo) {
- curMaxCwnds.add(peak.getCwnd());
- if (maxPeakSpeed == null ||
- PeakInfo.getPeakSpeedInMbps(peak.getCwnd(), peak.getSampleRTT()) >
- PeakInfo.getPeakSpeedInMbps(maxPeakSpeed.getCwnd(), maxPeakSpeed.getSampleRTT())) {
- maxPeakSpeed = (MaxPeakInfo) peak;
- }
- }
- else {
- curMinCwnds.add(peak.getCwnd());
- if (minPeakSpeed == null ||
- PeakInfo.getPeakSpeedInMbps(peak.getCwnd(), peak.getSampleRTT()) <
- PeakInfo.getPeakSpeedInMbps(minPeakSpeed.getCwnd(), minPeakSpeed.getSampleRTT())) {
- minPeakSpeed = (MinPeakInfo) peak;
- }
- }
- }
-
- // fetch percentiles
- if (curMaxCwnds.size() > 0) {
- max25 = curMaxCwnds.toArray(new Integer[]{})[curMaxCwnds.size() * 1 / 4];
- max50 = curMaxCwnds.toArray(new Integer[]{})[curMaxCwnds.size() * 2 / 4];
- max75 = curMaxCwnds.toArray(new Integer[]{})[curMaxCwnds.size() * 3 / 4];
- maxJitter = max75 - max25;
- }
- if (curMinCwnds.size() > 0) {
- min25 = curMinCwnds.toArray(new Integer[]{})[curMinCwnds.size() * 1 / 4];
- min50 = curMinCwnds.toArray(new Integer[]{})[curMinCwnds.size() * 2 / 4];
- min75 = curMinCwnds.toArray(new Integer[]{})[curMinCwnds.size() * 3 / 4];
- minJitter = min75 - min25;
- }
-
-
- /* ---------------------------------------------- */
-
- if (snaplogFilename != null) {
- ndttraceFilename = "ndttrace." + snaplogFilename.substring(snaplogFilename.indexOf("-")+1);
- if (!mainWindow.checkTcpDump(ndttraceFilename)) {
- ndttraceFilename = null;
- }
- }
- }
-
- private String describeDetLink(int num) {
- switch (num) {
- case -2: return "Insufficent Data";
- case -1: return "System Fault";
- case 0: return "RTT";
- case 1: return "Dial-up";
- case 2: return "T1";
- case 3: return "Ethernet";
- case 4: return "T3";
- case 5: return "FastEthernet";
- case 6: return "OC-12";
- case 7: return "Gigabit Ethernet";
- case 8: return "OC-48";
- case 9: return "10 Gigabit Enet";
- case 10: return "Retransmissions";
- }
- return "Unknown";
- }
-
- private double decodeLinkSpeed(int num) {
- switch (num) {
- case 1: return .064;
- case 0:
- case 2: return 3;
- case 3: return 10;
- case 4: return 45;
- case 5: return 100;
- case 6: return 622;
- case 7: return 1000;
- case 8: return 2400;
- case 9: return 10000;
- }
- return -1;
- }
-
- private int encodeLinkSpeed(double linkSpeed) {
- if (linkSpeed < .128) {
- return 1;
- }
- if (linkSpeed >= 3 && linkSpeed <= 6) {
- return 2;
- }
- if (linkSpeed >= 10 && linkSpeed <= 20) {
- return 3;
- }
- if (linkSpeed >= 45 && linkSpeed <= 90) {
- return 4;
- }
- if (linkSpeed >= 100 && linkSpeed <= 200) {
- return 5;
- }
- if (linkSpeed >= 622 && linkSpeed < 1000) {
- return 6;
- }
- if (linkSpeed >= 1000 && linkSpeed <= 2000) {
- return 7;
- }
- if (linkSpeed >= 2400 && linkSpeed <= 4800) {
- return 8;
- }
- if (linkSpeed >= 10000 && linkSpeed <= 20000) {
- return 9;
- }
- return -1;
- }
-
- public String toString() {
- return date + " " + ip_addr + " " + port;
- }
-
- public String getIP() {
- return ip_addr;
- }
-
- public int getCongestion() {
- return congestion2;
- }
-
- public int getMismatch() {
- return mismatch;
- }
-
- public int getDuplex() {
- return half_duplex;
- }
-
- public int getCable() {
- return bad_cable;
- }
-
- public int getNewCongestion() {
- return normalOperation ? 0 : 1;
- }
-
- public int getInitialPeakSpeedEquality() {
- if (initPeakSpeed == -1) {
- return 0;
- }
- if (initPeakSpeed == linkType) {
- return 1;
- }
- else if (initPeakSpeed > linkType) {
- return 2;
- }
- else {
- return 3;
- }
- }
-
- public Component getInfoPane() {
- final SimpleTextPane panel = new SimpleTextPane();
- panel.append("Client --> Server data detects link = " + describeDetLink(c2sdata) + "\n");
- panel.append("Client <-- Server Ack's detect link = " + describeDetLink(c2sack) + "\n");
- panel.append("Server --> Client data detects link = " + describeDetLink(s2cdata) + "\n");
- panel.append("Server <-- Client Ack's detect link = " + describeDetLink(s2cack) + "\n\n");
- panel.append("Acks = " + Helpers.formatDouble(acks, 4) + ", async speed = " +
- Helpers.formatDouble(aspeed, 4) + ", mismatch3 = " + Helpers.formatDouble(cong, 4) +
- ", CongOver = " + congestionOverCount + "\n");
- panel.append(("idle = " + Helpers.formatDouble(idle, 4) + ", timeout/pkts = " +
- Helpers.formatDouble(touts, 2) + ", %retranmissions = " +
- Helpers.formatDouble(retrn*100, 2) + ", %increase = " +
- Helpers.formatDouble(increase*100, 2)) + "\n");
- panel.append("FastRetrans/Total = " + Helpers.formatDouble(retrn, 4) + ", Fast/Retrans = " +
- Helpers.formatDouble(fr_ratio, 4) + ", Retrans/sec = " +
- Helpers.formatDouble(retransec, 4) + "\n\n");
- panel.append("Throughput to host [" + ip_addr + "] is limited by " + btlneck + "\n\n");
- panel.append("\tWeb100 says link = " + link + ", speed-chk says link = " + c2sdata + "\n");
- panel.append("\tSpeed-chk says {" + c2sdata + ", " + c2sack + ", " + s2cdata + ", " + s2cack +
- "}, Running average = {" + Helpers.formatDouble(runave[0], 1) + ", " +
- Helpers.formatDouble(runave[1], 1) + ", " + Helpers.formatDouble(runave[2], 1) + ", " +
- Helpers.formatDouble(runave[3], 1) + "}\n");
- if ((c2sspd > 1000) && (bw > 1)) {
- panel.append("\tC2Sspeed = " + Helpers.formatDouble(c2sspd/1000.0, 2) + " Mbps, S2Cspeed = " +
- Helpers.formatDouble(s2cspd/1000.0, 2) + " Mbps\n");
- panel.append("CWND-Limited = " + Helpers.formatDouble(s2c2spd/1000.0, 2) + " Mbps, " +
- "Estimate = " + Helpers.formatDouble(bw, 2) + " Mbps (" +
- Helpers.formatDouble(bw2, 2) + " Mbps)\n");
- }
- else if (c2sspd > 1000) {
- panel.append("\tC2Sspeed = " + Helpers.formatDouble(c2sspd/1000.0, 2) + " Mbps, S2Cspeed = " +
- Helpers.formatDouble(s2cspd/1000.0, 2) + " Mbps\n");
- panel.append("CWND-Limited = " + Helpers.formatDouble(s2c2spd/1000.0, 2) + " Mbps, " +
- "Estimate = " + Helpers.formatDouble(bw*1000, 2) + " kbps (" +
- Helpers.formatDouble(bw2*1000, 2) + " kbps)\n");
- }
- else if (bw > 1) {
- panel.append("\tC2Sspeed = " + c2sspd + " kbps, S2Cspeed = " + s2cspd + " kbps\n");
- panel.append("CWND-Limited: " + s2c2spd + " kbps, Estimate = " +
- Helpers.formatDouble(bw, 2) + " Mbps (" + Helpers.formatDouble(bw2, 2) + " Mbps)\n");
- }
- else {
- panel.append("\tC2Sspeed = " + c2sspd + " kbps, S2Cspeed = " + s2cspd + " kbps\n");
- panel.append("CWND-Limited: " + s2c2spd + " kbps, " +
- "Estimate = " + Helpers.formatDouble(bw*1000, 2) + " kbps (" +
- Helpers.formatDouble(bw2*1000, 2) + " kbps)\n");
- }
- String estimates;
- if ((bw*1000) > s2cspd)
- estimates ="\tOld estimate is greater than measured; ";
- else
- estimates = "\tOld estimate is less than measured; ";
-
- if (congestionSignals == -1)
- estimates += "No data collected to calculage new estimate";
- else {
- if ((bw2*1000) > s2cspd)
- estimates += "New estimate is greater than measured";
- else
- estimates += "New estimate is less than measured";
- }
- panel.append(estimates + "\n");
- panel.append("\tLoss = " + Helpers.formatDouble(loss*100, 2) + "% (" +
- Helpers.formatDouble(loss2*100, 2) + "%), Out-of-Order = " +
- Helpers.formatDouble(order*100, 2) + "%, Long tail = {" + tail[0] +
- ", " + tail[1] + ", " + tail[2] + ", " + tail[3] + "}\n");
- panel.append("\tDistribution = {" + head[0] + ", " + head[1] + ", " + head[2] + ", " + head[3] +
- "}, time spent {r=" + Helpers.formatDouble(rwintime*100, 1) + "% c=" +
- Helpers.formatDouble(cwndtime*100, 1) + "% s=" + Helpers.formatDouble(sendtime*100, 1)+"%}\n");
- panel.append("\tAve(min) RTT = " + Helpers.formatDouble(avgrtt, 2) + " (" + minRTT +
- ") msec, Buffers = {r=" + maxRwinRcvd + ", c=" + currentCwnd + ", s=" + sndBuf/2 + "}\n");
- panel.append("\tbw*delay = {r=" + Helpers.formatDouble(recvbwd, 2) + ", c=" +
- Helpers.formatDouble(cwndbwd, 2) + ", s=" + Helpers.formatDouble(sendbwd, 2) +
- "}, Transitions/sec = {r=" + Helpers.formatDouble(sndLimTransRwin/timesec, 1) + ", c=" +
- Helpers.formatDouble(sndLimTransCwnd/timesec, 1) + ", s=" +
- Helpers.formatDouble(sndLimTransSender/timesec, 1) + "}\n");
- panel.append("\tRetransmissions/sec = " + Helpers.formatDouble(pktsRetrans/timesec, 1) +
- ", Timeouts/sec = " + Helpers.formatDouble(timeouts/timesec, 1) + ", SSThreshold = " +
- maxSsthresh + "\n");
- String mismatchText = "\tMismatch = " + mismatch + " (" + mismatch2 + ":" + mismatch3 + "[" +
- Helpers.formatDouble(mmorder, 2) + "])";
- if (mismatch3 == 1)
- mismatchText += " [H=F, S=H]";
- if (mismatch2 == 1)
- mismatchText += " [H=H, S=F]";
-
- SimpleAttributeSet green = new SimpleAttributeSet();
- green.addAttribute(StyleConstants.ColorConstants.Foreground, Color.GREEN);
-
- SimpleAttributeSet red = new SimpleAttributeSet();
- red.addAttribute(StyleConstants.ColorConstants.Foreground, Color.RED);
-
- panel.appendColored(mismatchText + "\n", mismatch == 0 ? green : red);
-
- panel.appendColored("Cable fault = " + bad_cable + "\n", bad_cable == 0 ? green : red);
-
- panel.appendColored("Congestion = " + congestion2 + "\n", congestion2 == 0 ? green : red);
-
- panel.appendColored("Duplex = " + half_duplex + "\n\n", half_duplex == 0 ? green : red);
-
- panel.append("S2C Snaplog file: ");
- if (snaplogFilename != null) {
- if (ssCurCwnd == -1) {
- panel.appendColored(snaplogFilename + "\n", red);
- }
- else {
- panel.append(snaplogFilename + " ");
- JButton viewButton = new JButton("View");
- viewButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- String snaplogData = mainWindow.getSnaplogData(snaplogFilename, null, 0, false);
- JTextArea area = new JTextArea(snaplogData);
- area.setEditable(false);
- JFrame frame = new JFrame("Snaplog variables");
- frame.getContentPane().add(new JScrollPane(area), BorderLayout.CENTER);
- frame.setSize(800, 600);
- frame.setVisible(true);
- }
- });
- panel.insertComponent(viewButton);
- JButton plotButton = new JButton("Plot");
- plotButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- mainWindow.plotSnaplog(snaplogFilename);
- }
- });
- panel.insertComponent(plotButton);
- JButton cPlotButton = new JButton("Plot CWND");
- cPlotButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- mainWindow.plotSnaplogCWND(snaplogFilename);
- }
- });
- panel.insertComponent(cPlotButton);
- }
- }
- else {
- panel.appendColored("N/A", red);
- }
-
- panel.append("\nC2S Snaplog file: ");
- if (c2sSnaplogFilename != null) {
- if (ssCurCwnd == -1) {
- panel.appendColored(c2sSnaplogFilename + "\n", red);
- }
- else {
- panel.append(c2sSnaplogFilename + " ");
- JButton viewButton = new JButton("View");
- viewButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- String snaplogData = mainWindow.getSnaplogData(c2sSnaplogFilename, null, 0, false);
- JTextArea area = new JTextArea(snaplogData);
- area.setEditable(false);
- JFrame frame = new JFrame("Snaplog variables");
- frame.getContentPane().add(new JScrollPane(area), BorderLayout.CENTER);
- frame.setSize(800, 600);
- frame.setVisible(true);
- }
- });
- panel.insertComponent(viewButton);
- JButton plotButton = new JButton("Plot");
- plotButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- mainWindow.plotSnaplog(c2sSnaplogFilename);
- }
- });
- panel.insertComponent(plotButton);
- JButton cPlotButton = new JButton("Plot CWND");
- cPlotButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- mainWindow.plotSnaplogCWND(c2sSnaplogFilename);
- }
- });
- panel.insertComponent(cPlotButton);
- }
- }
- else {
- panel.appendColored("N/A", red);
- }
-
- panel.append("\nTcpdump trace file: ");
- if (ndttraceFilename != null) {
- panel.append(ndttraceFilename + " ");
-
- JButton viewButton = new JButton("View");
- viewButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- String tcpdumpData = mainWindow.getTcpdumpData(ndttraceFilename);
- JTextArea area = new JTextArea(tcpdumpData);
- area.setEditable(false);
- JFrame frame = new JFrame("tcpdump trace");
- frame.getContentPane().add(new JScrollPane(area), BorderLayout.CENTER);
- frame.setSize(800, 600);
- frame.setVisible(true);
- }
- });
- panel.insertComponent(viewButton);
- JButton plotButton = new JButton("Plot");
- plotButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- mainWindow.plotTcpdumpS(ndttraceFilename);
- }
- });
- panel.insertComponent(plotButton);
- }
- else {
- panel.appendColored("N/A", red);
- }
-
- panel.append("\nCputime trace file: ");
- if (cputraceFilename != null) {
- panel.append(cputraceFilename + " ");
- JButton viewButton = new JButton("View");
- viewButton.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e) {
- mainWindow.plotCputime(cputraceFilename);
- }
***The diff for this file has been truncated for email.***
=======================================
--- /trunk/janalyze/src/ResultsList.java Tue Nov 13 19:16:15 2007 UTC
+++ /dev/null
@@ -1,23 +0,0 @@
-import java.util.Collection;
-import java.util.Vector;
-
-import javax.swing.AbstractListModel;
-
-
-public class ResultsList extends AbstractListModel {
-
- private static final long serialVersionUID = 1L;
- private Vector<ResultsContainer> results = new
Vector<ResultsContainer>();
-
- public ResultsList(Collection<ResultsContainer> results) {
- this.results.addAll(results);
- }
- public Object getElementAt(int arg0) {
- return results.get(arg0);
- }
-
- public int getSize() {
- return results.size();
- }
-
-}
=======================================
--- /trunk/janalyze/src/SimpleTextPane.java Thu Nov 15 21:17:15 2007 UTC
+++ /dev/null
@@ -1,37 +0,0 @@
-import javax.swing.JTextPane;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.AttributeSet;
-
-import java.awt.Component;
-
-public class SimpleTextPane extends JTextPane
- {
- private static final long serialVersionUID = 1L;
-
- public void append(String text)
- {
- try {
- getStyledDocument().insertString(getStyledDocument().getLength(), text, null);
- }
- catch (BadLocationException e) {
- System.out.println("WARNING: failed to append text to the text pane! [" + text + "]");
- }
- }
-
- public void appendColored(String text, AttributeSet attributes)
- {
- try {
- getStyledDocument().insertString(getStyledDocument().getLength(), text, attributes);
- }
- catch (BadLocationException e) {
- System.out.println("WARNING: failed to append text to the text pane! [" + text + "]");
- }
- }
-
- public void insertComponent(Component c)
- {
- setSelectionStart(getStyledDocument().getLength());
- setSelectionEnd(getStyledDocument().getLength());
- super.insertComponent(c);
- }
- }
=======================================
--- /trunk/janalyze/src/SnaplogFrame.java Thu Nov 15 21:17:15 2007 UTC
+++ /dev/null
@@ -1,90 +0,0 @@
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.BoxLayout;
-import javax.swing.JLabel;
-import javax.swing.JTextField;
-import java.awt.Container;
-
-public class SnaplogFrame extends JFrame
-{
- private static final long serialVersionUID = 1L;
- private JTextField genplot = new JTextField(20);
- private JTextField xplot = new JTextField(20);
- private JTextField tcptrace = new JTextField(20);
- private JTextField snaplogs = new JTextField(20);
- private JTextField variables = new JTextField(40);
-
- public SnaplogFrame(JAnalyze mainWindow) {
-
- Container cp = getContentPane();
- cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
- JPanel panel = new JPanel();
- JPanel tmpPanel = new JPanel();
- panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
- panel.add(new JLabel("Genplot:"));
- genplot.setText(mainWindow.getProperties().getProperty("genplot", "/usr/local/bin/genplot"));
- genplot.getDocument().addDocumentListener(new PropertyListener(mainWindow, "genplot"));
- panel.add(genplot);
- tmpPanel.add(panel);
- cp.add(tmpPanel);
- panel = new JPanel();
- tmpPanel = new JPanel();
- panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
- panel.add(new JLabel("Xplot:"));
- xplot.setText(mainWindow.getProperties().getProperty("xplot", "/usr/local/bin/xplot"));
- xplot.getDocument().addDocumentListener(new PropertyListener(mainWindow, "xplot"));
- panel.add(xplot);
- tmpPanel.add(panel);
- cp.add(tmpPanel);
- panel = new JPanel();
- tmpPanel = new JPanel();
- panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
- panel.add(new JLabel("Tcptrace:"));
- tcptrace.setText(mainWindow.getProperties().getProperty("tcptrace", "/usr/local/bin/tcptrace"));
- tcptrace.getDocument().addDocumentListener(new PropertyListener(mainWindow, "tcptrace"));
- panel.add(tcptrace);
- tmpPanel.add(panel);
- cp.add(tmpPanel);
- panel = new JPanel();
- tmpPanel = new JPanel();
- panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
- panel.add(new JLabel("Snaplog directory:"));
- snaplogs.setText(mainWindow.getProperties().getProperty("snaplogs", ""));
- snaplogs.getDocument().addDocumentListener(new PropertyListener(mainWindow, "snaplogs"));
- panel.add(snaplogs);
- tmpPanel.add(panel);
- cp.add(tmpPanel);
- panel = new JPanel();
- tmpPanel = new JPanel();
- panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
- panel.add(new JLabel("Variables:"));
- variables.setText(mainWindow.getProperties().getProperty("variables",
-
"CurCwnd,SampleRTT,SlowStart,MaxRTT,CurSsthresh,CongestionSignals"));
- variables.getDocument().addDocumentListener(new PropertyListener(mainWindow, "variables"));
- panel.add(variables);
- tmpPanel.add(panel);
- cp.add(tmpPanel);
-
- setSize(515, 180);
- }
-
- public String getGenplot() {
- return genplot.getText();
- }
-
- public String getXplot() {
- return xplot.getText();
- }
-
- public String getTcptrace() {
- return tcptrace.getText();
- }
-
- public String getSnaplogs() {
- return snaplogs.getText();
- }
-
- public String getVariables() {
- return variables.getText();
- }
-}
=======================================
--- /trunk/janalyze/src/SwingWorker.java Tue Nov 13 19:16:15 2007 UTC
+++ /dev/null
@@ -1,128 +0,0 @@
-import javax.swing.SwingUtilities;
-
-/**
- * This is the 3rd version of SwingWorker (also known as
- * SwingWorker 3), an abstract class that you subclass to
- * perform GUI-related work in a dedicated thread. For
- * instructions on and examples of using this class, see:
- *
- * http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html
- *
- * Note that the API changed slightly in the 3rd version:
- * You must now invoke start() on the SwingWorker after
- * creating it.
- */
-public abstract class SwingWorker {
- private Object value; // see getValue(), setValue()
-
- /**
- * Class to maintain reference to current worker thread
- * under separate synchronization control.
- */
- private static class ThreadVar {
- private Thread thread;
- ThreadVar(Thread t) { thread = t; }
- synchronized Thread get() { return thread; }
- synchronized void clear() { thread = null; }
- }
-
- private ThreadVar threadVar;
-
- /**
- * Get the value produced by the worker thread, or null if it
- * hasn't been constructed yet.
- */
- protected synchronized Object getValue() {
- return value;
- }
-
- /**
- * Set the value produced by worker thread
- */
- private synchronized void setValue(Object x) {
- value = x;
- }
-
- /**
- * Compute the value to be returned by the <code>get</code> method.
- */
- public abstract Object construct();
-
- /**
- * Called on the event dispatching thread (not on the worker thread)
- * after the <code>construct</code> method has returned.
- */
- public void finished() {
- }
-
- /**
- * A new method that interrupts the worker thread. Call this method
- * to force the worker to stop what it's doing.
- */
- public void interrupt() {
- Thread t = threadVar.get();
- if (t != null) {
- t.interrupt();
- }
- threadVar.clear();
- }
-
- /**
- * Return the value created by the <code>construct</code> method.
- * Returns null if either the constructing thread or the current
- * thread was interrupted before a value was produced.
- *
- * @return the value created by the <code>construct</code> method
- */
- public Object get() {
- while (true) {
- Thread t = threadVar.get();
- if (t == null) {
- return getValue();
- }
- try {
- t.join();
- }
- catch (InterruptedException e) {
- Thread.currentThread().interrupt(); // propagate
- return null;
- }
- }
- }
-
- /**
- * Start a thread that will call the <code>construct</code> method
- * and then exit.
- */
- public SwingWorker() {
- final Runnable doFinished = new Runnable() {
- public void run() { finished(); }
- };
-
- Runnable doConstruct = new Runnable() {
- public void run() {
- try {
- setValue(construct());
- }
- finally {
- threadVar.clear();
- }
-
- SwingUtilities.invokeLater(doFinished);
- }
- };
-
- Thread t = new Thread(doConstruct);
- threadVar = new ThreadVar(t);
- }
-
- /**
- * Start the worker thread.
- */
- public void start() {
- Thread t = threadVar.get();
- if (t != null) {
- t.start();
- }
- }
-}
=======================================
--- /trunk/Admin/Makefile.am Sun Aug 19 10:26:07 2007 UTC
+++ /trunk/Admin/Makefile.am Tue Feb 11 09:19:57 2014 UTC
@@ -16,16 +16,18 @@
# Description:

GCJLINK = $(GCJLD)
+NDTGCJFLAGS = -d bin -sourcepath src
CLASSPATH_ENV =
+TEMPDIRS = bin

noinst_PROGRAMS = Admin.class

ndtdir = $(prefix)/ndt
-ndt_DATA = Admin.class
-Admindir = $(ndtdir)
+ndt_DATA = bin/edu/internet2/ndt/Admin.class
+Admindir = $(ndtdir)/Admin

-Admin_JAVA = Admin.java
-Admin_class_SOURCES = Admin.java
+Admin_JAVA = src/edu/internet2/ndt/Admin.java
+Admin_class_SOURCES = src/edu/internet2/ndt/Admin.java

Admin$(EXEEXT): $(Admin_OBJECTS) $(Admin_DEPENDENCIES)
@rm -f Admin$(EXEEXT)
@@ -34,12 +36,27 @@
echo timestamp > classAdmin.stamp; \
else :; fi

+install-ndtDATA: $(ndt_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(ndtdir)" || $(mkdir_p) "$(DESTDIR)$(ndtdir)"
+ test -z "$(Admindir)/edu" || $(mkdir_p) "$(DESTDIR)$(Admindir)/edu"
+ test -z "$(Admindir)/edu/internet2" || $(mkdir_p) "$(DESTDIR)$(Admindir)/edu/internet2"
+ test -z "$(Admindir)/edu/internet2/ndt" || $(mkdir_p) "$(DESTDIR)$(Admindir)/edu/internet2/ndt"
+ echo " $(INSTALL_DATA) "$(ndt_DATA)" '$(DESTDIR)$(Admindir)/edu/internet2/ndt/'"; \
+ $(INSTALL_DATA) "$(ndt_DATA)"
"$(DESTDIR)$(Admindir)/edu/internet2/ndt/";
+
+bin:
+ mkdir -p bin
+
classAdmin.stamp: $(Admin_JAVA)
if test -n "$?"; then \
- echo '$(GCJ) $?' ; \
- $(GCJ) $?; \
+ echo '$(GCJ) $(NDTGCJFLAGS) $?' ; \
+ $(GCJ) $(NDTGCJFLAGS) $?; \
else :; fi
echo timestamp > classAdmin.stamp

-Admin.class: $(Admin_JAVA)
- $(GCJ) $(Admin_JAVA)
+mostlyclean-generic:
+ rm -rf $(TEMPDIRS) *~
+
+Admin.class: $(Admin_JAVA) $(TEMPDIRS)
+ $(GCJ) $(NDTGCJFLAGS) $(Admin_JAVA)
=======================================
--- /trunk/admin.html Fri Aug 18 10:16:24 2006 UTC
+++ /trunk/admin.html Tue Feb 11 09:19:57 2014 UTC
@@ -56,7 +56,7 @@
</tr>
</table>

-<applet code=Admin.class
+<applet codebase=Admin code=edu.internet2.ndt.Admin.class
width=600 height=400>
<PARAM NAME="Fault" VALUE="9">
<PARAM NAME="RTT" VALUE="0">
=======================================
--- /trunk/janalyze/MANIFEST.MF Wed Oct 10 22:03:10 2007 UTC
+++ /trunk/janalyze/MANIFEST.MF Tue Feb 11 09:19:57 2014 UTC
@@ -1,3 +1,3 @@
Manifest-Version: 1.0
Created-By: My own fingers
-Main-Class: JAnalyze
+Main-Class: edu/internet2/ndt/JAnalyze
=======================================
--- /trunk/janalyze/Makefile.am Sun Feb 28 19:29:32 2010 UTC
+++ /trunk/janalyze/Makefile.am Tue Feb 11 09:19:57 2014 UTC
@@ -8,7 +8,7 @@
#
# File: Makefile.am
#
-# Author: Jakub S³awiñski
+# Author: Jakub Sławiński
#
# Date: Wed Oct 10 23:33:27 CEST 2007
#
@@ -16,7 +16,7 @@

GCJLINK = $(GCJLD)
CLASSPATH_ENV =
-NDTGCJFLAGS = -cp external:src -d bin
+NDTGCJFLAGS = -cp external:src/edu/internet2/ndt -d bin -sourcepath src
GCJFLAGS =
TEMPDIRS = bin dist

@@ -27,12 +27,13 @@

noinst_PROGRAMS = JAnalyze.jar

-JAnalyze_JAVA = src/JAnalyze.java src/DBConfFrame.java src/FilterFrame.java \
- src/Helpers.java src/LoadingDBFrame.java
src/LoadingFrame.java \
- src/MaxPeakInfo.java src/MinPeakInfo.java
src/PeakInfo.java \
- src/PropertyListener.java
src/ResultsContainer.java \
- src/ResultsList.java src/SimpleTextPane.java
src/SnaplogFrame.java \
- src/SwingWorker.java
+JAnalyze_JAVA = src/edu/internet2/ndt/JAnalyze.java src/edu/internet2/ndt/DBConfFrame.java src/edu/internet2/ndt/FilterFrame.java \
+ src/edu/internet2/ndt/Helpers.java src/edu/internet2/ndt/LoadingDBFrame.java \
+ src/edu/internet2/ndt/LoadingFrame.java src/edu/internet2/ndt/MaxPeakInfo.java \
+ src/edu/internet2/ndt/MinPeakInfo.java src/edu/internet2/ndt/PeakInfo.java \
+ src/edu/internet2/ndt/PropertyListener.java src/edu/internet2/ndt/ResultsContainer.java \
+ src/edu/internet2/ndt/ResultsList.java src/edu/internet2/ndt/SimpleTextPane.java \
+ src/edu/internet2/ndt/SnaplogFrame.java src/edu/internet2/ndt/SwingWorker.java

JAnalyze_jar_SOURCES = $(JAnalyze_JAVA)

@@ -43,15 +44,20 @@
echo timestamp > classJAnalyze.stamp; \
else :; fi

-install-JAnalyzeJAVA: classJAnalyze.stamp
+create-packageDirs:
+ test -z "$(JAnalyzedir)/edu" || $(mkdir_p)
"$(DESTDIR)$(JAnalyzedir)/edu"
+ test -z "$(JAnalyzedir)/edu/internet2" || $(mkdir_p) "$(DESTDIR)$(JAnalyzedir)/edu/internet2"
+ test -z "$(JAnalyzedir)/edu/internet2/ndt" || $(mkdir_p) "$(DESTDIR)$(JAnalyzedir)/edu/internet2/ndt"
+
+install-JAnalyzeJAVA: classJAnalyze.stamp create-packageDirs
@$(NORMAL_INSTALL)
- test -z "$(JAnalyzedir)" || $(mkdir_p) "$(DESTDIR)$(JAnalyzedir)"
- @test -z "$(JAnalyze_JAVA/bin)" || for p in *.class; do \
- echo " $(INSTALL_DATA) '$$p' '$(DESTDIR)$(JAnalyzedir)/$$p'";
\
- $(INSTALL_DATA) "$$p" "$(DESTDIR)$(JAnalyzedir)/$$p"; \
+ test -z "$(JAnalyzedir)" || $(mkdir_p) "$(DESTDIR)$(JAnalyzedir)"
+ @test -z "$(JAnalyze_JAVA/bin/edu/internet2/ndt)" || for p in *.class; do \
+ echo " $(INSTALL_DATA) '$$p' '$(DESTDIR)$(JAnalyzedir)/edu/internet2/ndt/$$p'"; \
+ $(INSTALL_DATA) "$$p"
"$(DESTDIR)$(JAnalyzedir)/edu/internet2/ndt/$$p"; \
done

-install-ndtDATA: $(ndt_DATA)
+install-ndtDATA: $(ndt_DATA) create-packageDirs
@$(NORMAL_INSTALL)
test -z "$(ndtdir)" || $(mkdir_p) "$(DESTDIR)$(ndtdir)"
@list='dist/$(ndt_DATA)'; for p in $$list; do \
@@ -60,11 +66,11 @@
echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(JAnalyzedir)/$$f'"; \
$(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(JAnalyzedir)/$$f"; \
done
- @list='bin/*.class'; for p in $$list; do \
+ @list='bin/edu/internet2/ndt/*.class'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__strip_dir) \
- echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(JAnalyzedir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(JAnalyzedir)/$$f"; \
+ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(JAnalyzedir)/edu/internet2/ndt/$$f'"; \
+ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(JAnalyzedir)/edu/internet2/ndt/$$f"; \
done
/bin/cp -Rp external/de $(DESTDIR)$(JAnalyzedir)/



  • [ndt-dev] [ndt] r897 committed - Merge AppletIssue120 branch into trunk, ndt, 02/11/2014

Archive powered by MHonArc 2.6.16.

Top of Page