Skip to main content

[perfdata~pda:5] Bugfixes and Parser Enhancements

  • From:
  • To:
  • Subject: [perfdata~pda:5] Bugfixes and Parser Enhancements
  • Date: Thu, 29 Mar 2012 03:32:12 +0000

Project:    perfdata
Repository: pda
Revision:   5
Author:     nicolasmichael
Date:       2012-03-29 03:32:09 UTC
Link:       

Log Message:
------------
Bugfixes and Parser Enhancements


Revisions:
----------
5


Modified Paths:
---------------
src/de/nmichael/pda/gui/MainFrame.java
src/de/nmichael/pda/parser/Vmstat.java
src/de/nmichael/pda/data/CategoryGroups.java
src/de/nmichael/pda/parser/Ping.java
src/de/nmichael/pda/parser/Gc.java
src/de/nmichael/pda/parser/Prstat.java
src/de/nmichael/pda/Main.java
src/de/nmichael/pda/data/TimeStamp.java
src/de/nmichael/pda/Parsers.java
src/de/nmichael/pda/parser/Ps.java
src/de/nmichael/pda/data/ILoadSteps.java
src/de/nmichael/pda/parser/Mpstat.java
src/de/nmichael/pda/parser/Iostat.java
src/de/nmichael/pda/ConfigFile.java
src/de/nmichael/pda/gui/ConfigureProjectFrame.java
src/de/nmichael/pda/data/LoadSteps.java
src/de/nmichael/pda/Logger.java
src/de/nmichael/pda/BatchMode.java
src/de/nmichael/pda/data/DataSet.java
src/de/nmichael/pda/parser/Logfile.java
src/de/nmichael/pda/parser/Netstat.java
src/de/nmichael/pda/gui/SeriesStatisticsFrame.java


Added Paths:
------------
src/de/nmichael/pda/parser/SarLinux.java
src/de/nmichael/pda/parser/WlsStats.java
src/de/nmichael/pda/parser/TypeValue.java
src/de/nmichael/pda/parser/WebLogicServerLog.java
src/de/nmichael/pda/parser/FabanDriverStats.java
src/de/nmichael/pda/parser/Nicstat.java
src/de/nmichael/pda/data/Quantiles.java


Diffs:
------
Index: src/de/nmichael/pda/Logger.java
===================================================================
--- src/de/nmichael/pda/Logger.java     (revision 4)
+++ src/de/nmichael/pda/Logger.java     (revision 5)
@@ -14,6 +14,8 @@
 import java.util.GregorianCalendar;
 
 public class Logger {
+    
+    private static boolean debugLogging = false;
 
     public enum LogType {
         info,
@@ -55,7 +57,14 @@
     }
     
     public static void log(LogType type, String msg) {
+        if (type == LogType.debug && !debugLogging) {
+            return;
+        }
         System.out.println("[" + getCurrentTimeStamp() + "] - " + 
getTypeString(type) + " - " + msg);
     }
     
+    public static boolean isDebugLoggin() {
+        return debugLogging;
+    }
+    
 }
Index: src/de/nmichael/pda/Parsers.java
===================================================================
--- src/de/nmichael/pda/Parsers.java    (revision 4)
+++ src/de/nmichael/pda/Parsers.java    (revision 5)
@@ -12,15 +12,18 @@
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Arrays;
 
 public class Parsers {
     
     private static ArrayList<String> parsers = new ArrayList<String>();
+    private static boolean sorted = true;
     
     private static void registerParser(String className) {
         try {
             Class.forName(className).newInstance();
             parsers.add(className);
+            sorted = false;
             Logger.log(Logger.LogType.info, "Found Parser: " + className);
         } catch (Exception e) {
             Logger.log(Logger.LogType.error, "Error registering Parser " + 
className + ": " + e.toString());        
@@ -71,6 +74,15 @@
     
        
     public static int getNumberOfParsers() {
+        if (!sorted) {
+            String[] a = parsers.toArray(new String[0]);
+            Arrays.sort(a);
+            parsers = new ArrayList<String>();
+            for (String s : a) {
+                parsers.add(s);
+            }
+            sorted = true;
+        }
         return (parsers == null ? 0 : parsers.size());
     }
     
Index: src/de/nmichael/pda/Main.java
===================================================================
--- src/de/nmichael/pda/Main.java       (revision 4)
+++ src/de/nmichael/pda/Main.java       (revision 5)
@@ -17,7 +17,7 @@
 
 public class Main {
     
-    public static final String VERSIONID = "0.9.1_00";
+    public static final String VERSIONID = "0.9.1_03";
     
     public static final String PROGRAM = "Performance Data Analyzer";
     public static final String PROGRAMSHORT = "PDA";
Index: src/de/nmichael/pda/gui/MainFrame.java
===================================================================
--- src/de/nmichael/pda/gui/MainFrame.java      (revision 4)
+++ src/de/nmichael/pda/gui/MainFrame.java      (revision 5)
@@ -285,10 +285,10 @@
     }
     
     void saveImage(ActionEvent e) {        
-        String fname = DialogHelper.saveFileDlg(this,"Save Image", "PNG 
Image", "png", Main.config.getWorkdir());
+        String fname = DialogHelper.saveFileDlg(this,"Save Image", "PNG 
Image", "png", Main.config.getWorkdirProject());
         if (fname == null) return;
         if (fname.indexOf(".")<0) fname += ".png";
-        Main.config.setWorkdir(Util.getPathOfFile(fname));
+        Main.config.setWorkdirProject(Util.getPathOfFile(fname));
         String result = graphPanel.saveImageToFile(fname);
         if (result != null) {
             DialogHelper.errorDlg(this, result);
@@ -436,7 +436,7 @@
     }
     
     private void menuProjectOpen_actionPerformed(ActionEvent e) {
-        String fname = DialogHelper.openFileDlg(this,"Open Project", "PDA 
Project", "pda", Main.config.getWorkdir());
+        String fname = DialogHelper.openFileDlg(this,"Open Project", "PDA 
Project", "pda", Main.config.getWorkdirProject());
         if (fname == null) return;
         openProject(fname);
     }
@@ -450,7 +450,7 @@
     
     public void openProject(String fname) {
         project = new Project();
-        Main.config.setWorkdir(Util.getPathOfFile(fname));
+        Main.config.setWorkdirProject(Util.getPathOfFile(fname));
         
         project.setFileName(fname);
         if (project.loadFromFile()) {
@@ -483,10 +483,10 @@
     
     private void menuProjectSaveAs_actionPerformed(ActionEvent e) {
         if (project != null) {
-            String fname = DialogHelper.saveFileDlg(this,"Save Project", 
"PDA Project", "pda", Main.config.getWorkdir());
+            String fname = DialogHelper.saveFileDlg(this,"Save Project", 
"PDA Project", "pda", Main.config.getWorkdirProject());
             if (fname == null) return;
             if (fname.indexOf(".")<0) fname += ".pda";
-            Main.config.setWorkdir(Util.getPathOfFile(fname));
+            Main.config.setWorkdirProject(Util.getPathOfFile(fname));
             
             project.setFileName(fname);
             project.setLabels( (graphPanel != null ? 
graphPanel.getAllLabels() : null));
Index: src/de/nmichael/pda/gui/SeriesStatisticsFrame.java
===================================================================
--- src/de/nmichael/pda/gui/SeriesStatisticsFrame.java  (revision 4)
+++ src/de/nmichael/pda/gui/SeriesStatisticsFrame.java  (revision 5)
@@ -45,6 +45,7 @@
         this.vprop = vprop;
         try {
             jbInit();
+            initHeaderData();
             for (int i=0; i<vdata.size() && i<vprop.size(); i++) {
                 
initData((IDataSet)vdata.get(i),(DataProperties)vprop.get(i));
             }
@@ -91,6 +92,18 @@
         mainTextArea.append(space+s+"\n");
     }
     
+    private void initHeaderData() {
+        long xFrom = projectItem.getScaleMinX();
+        long xTo = projectItem.getScaleMaxX();
+        
+        addLine("Selected Time Interval");
+        
addLine("----------------------------------------------------------------");
+        addLine("Start of Interval : " + (xFrom == Long.MIN_VALUE ? "" : 
Sample.createTimeStampString(xFrom)));
+        addLine("End of Interval   : " + (xTo == Long.MAX_VALUE ? "" : 
Sample.createTimeStampString(xTo)));
+        addLine("Time elapsed      : "+ ((xTo - xFrom) / 1000)+" sec");
+        addLine("");
+    }
+    
     private void initData(IDataSet data, DataProperties prop) {
         long xFrom = Long.MIN_VALUE;
         long xTo = Long.MAX_VALUE;
@@ -104,9 +117,6 @@
         addLine("Series Statistics for Series: "+prop.getName());
         
addLine("================================================================");
         addLine("");
-        addLine("Start of Interval : " + (xFrom == Long.MIN_VALUE ? "" : 
Sample.createTimeStampString(xFrom)));
-        addLine("End of Interval   : " + (xTo == Long.MAX_VALUE ? "" : 
Sample.createTimeStampString(xTo)));
-        addLine("");
         if (stat.samplesCnt > 0) {
             addLine("Number of samples : "+stat.samplesCnt);
             addLine("First sample      : 
"+Sample.createTimeStampString(stat.firstSample));
Index: src/de/nmichael/pda/gui/ConfigureProjectFrame.java
===================================================================
--- src/de/nmichael/pda/gui/ConfigureProjectFrame.java  (revision 4)
+++ src/de/nmichael/pda/gui/ConfigureProjectFrame.java  (revision 5)
@@ -126,12 +126,12 @@
     void selectFilename(ActionEvent e) {
         JFileChooser dlg;
         try {
-            if (Main.config.getWorkdir() != null) dlg = new 
JFileChooser(Main.config.getWorkdir());
+            if (Main.config.getWorkdirData() != null) dlg = new 
JFileChooser(Main.config.getWorkdirData());
             else dlg = new JFileChooser();
             dlg.setDialogTitle("Select Data File");
             if (dlg.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                 String fname = dlg.getSelectedFile().toString();
-                Main.config.setWorkdir(Util.getPathOfFile(fname));
+                Main.config.setWorkdirData(Util.getPathOfFile(fname));
                 filename.setText(fname);
                 addFilename(e);
             }
Index: src/de/nmichael/pda/ConfigFile.java
===================================================================
--- src/de/nmichael/pda/ConfigFile.java (revision 4)
+++ src/de/nmichael/pda/ConfigFile.java (revision 5)
@@ -15,8 +15,12 @@
 
 public class ConfigFile {
     
+    private static final String WORKDIR_DATA    = "WORKDIR_DATA";
+    private static final String WORKDIR_PROJECT = "WORKDIR_PROJECT";
+    
     private String filename;
-    private String workdir;
+    private String workdirData;
+    private String workdirProject;
     
     /** Creates a new instance of ConfigFile */
     public ConfigFile(String filename) {
@@ -28,7 +32,8 @@
     }
     
     public void readConfig() throws Exception {
-        workdir = null;
+        workdirData = null;
+        workdirProject = null;
         
         if (filename == null) {
             findConfigFile();
@@ -40,10 +45,14 @@
             s = s.trim();
             if (s.length() == 0 || s.startsWith("#")) continue;
             
-            if (s.startsWith("WORKDIR=")) {
-                workdir = s.substring(8);
+            if (s.startsWith(WORKDIR_DATA + "=")) {
+                workdirData = s.substring(WORKDIR_DATA.length() + 1);
                 continue;
             }
+            if (s.startsWith(WORKDIR_PROJECT + "=")) {
+                workdirProject = s.substring(WORKDIR_PROJECT.length() + 1);
+                continue;
+            }
            
         }
         f.close();
@@ -51,20 +60,31 @@
     
     public void writeConfig() throws Exception {
         BufferedWriter f = new BufferedWriter(new FileWriter(filename));
-        if (workdir != null) {
-            f.write("WORKDIR="+workdir+"\n");
+        if (workdirData != null) {
+            f.write(WORKDIR_DATA + "="+workdirData+"\n");
         }
+        if (workdirProject != null) {
+            f.write(WORKDIR_PROJECT + "="+workdirProject+"\n");
+        }
 
         f.close();
     }
     
-    public String getWorkdir() {
-        return workdir;
+    public String getWorkdirData() {
+        return workdirData;
     }
     
-    public void setWorkdir(String workdir) {
-        this.workdir = workdir;
+    public void setWorkdirData(String workdir) {
+        this.workdirData = workdir;
     }
     
+    public String getWorkdirProject() {
+        return workdirProject;
+    }
     
+    public void setWorkdirProject(String workdir) {
+        this.workdirProject = workdir;
+    }
+    
+    
 }
Index: src/de/nmichael/pda/BatchMode.java
===================================================================
--- src/de/nmichael/pda/BatchMode.java  (revision 4)
+++ src/de/nmichael/pda/BatchMode.java  (revision 5)
@@ -157,6 +157,7 @@
                             
table.addField(Sample.createTimeStampStringOnlyTime(steps.getEnd(step))); if 
(endTime == 0) endTime = steps.getEnd(step);
                             
table.addField(Long.toString(steps.getLoad(step)/1000)); load += 
steps.getLoad(step);
                             
table.addField(Long.toString(steps.getActLoad(step)/1000)); actLoad += 
steps.getActLoad(step);
+                            /*
                             
table.addField(Long.toString(steps.getTotalRequests(step))); totalCalls += 
steps.getTotalRequests(step);
                             
table.addField(Long.toString(steps.getSuccessfulRequests(step))); 
successfulCalls += steps.getSuccessfulRequests(step);
                             
table.addField(Long.toString(steps.getFailedRequests(step))); failedCalls += 
steps.getFailedRequests(step);
@@ -165,6 +166,7 @@
                             table.addField(Util.round(steps.getRespMax(step, 
0))); setupMax = Math.max(setupMax, steps.getRespMax(step, 0));
                             table.addField(Util.round(steps.getRespAvg(step, 
0))); setupAvg += steps.getRespAvg(step, 0) * steps.getTotalRequests(step);
                             table.addField(Util.round(steps.getRespQ95(step, 
0))); setupQ95 = Math.max(setupQ95, steps.getRespQ95(step, 0));
+                            */
                         }
                         if (totalCalls > 0) {
                             cfr /= (double)totalCalls;
@@ -189,6 +191,7 @@
                         loadSteps.stepNew(startTime);
                         loadSteps.stepLoad(load);
                         loadSteps.stepActLoad(actLoad);
+                        /*
                         loadSteps.stepTotalRequests(totalCalls);
                         loadSteps.stepSuccessfullRequests(successfulCalls);
                         loadSteps.stepFailedRequests(failedCalls);
@@ -198,6 +201,7 @@
                         loadSteps.stepRespAvg(0, (float)setupAvg);
                         loadSteps.stepRespQ95(0, setupQ95);
                         loadSteps.stepEnd(endTime);
+                        */
                     }
                     if (html != null) {
                         table.printToFile(html);
Index: src/de/nmichael/pda/data/TimeStamp.java
===================================================================
--- src/de/nmichael/pda/data/TimeStamp.java     (revision 4)
+++ src/de/nmichael/pda/data/TimeStamp.java     (revision 5)
@@ -20,30 +20,41 @@
     
     public enum Fields {
         year, month, day, hour, minute, second, ms,
-        nameOfMonth, unixms
+        nameOfMonth, unixms, ampm
     }
     
     private int YY,MM,DD,hh,mm,ss,ms;
+    private long offHH = 0;
+    private long offMM = 0;
+    private long offSS = 0;
+    private boolean onlyTsWithDate = false;
     
     private ArrayList<String> pTimestampDescription = new 
ArrayList<String>();
     private ArrayList<Pattern> pTimestampPattern = new ArrayList<Pattern>();
     private ArrayList<Fields[]> pTimestampGroupOrder = new 
ArrayList<Fields[]>();
+
+    public TimeStamp(long offHH, long offMM, long offSS) {
+        initializePatterns();
+        reset(offHH, offMM, offSS);
+    }
     
-    public TimeStamp() {
-        initializePatterns();
+    public void reset(long offHH, long offMM, long offSS) {
         setToToday();
+        this.offHH = offHH;
+        this.offMM = offMM;
+        this.offSS = offSS;
     }
     
     private synchronized void initializePatterns() {
         // typical YYYY-MM-DD hh:mm:ss timestamp
-        addTimeStampPattern("YYYY[.-/]MM[.-/]DD[- ]hh[:-.]mm[:-.]ss",
-                            
Pattern.compile(".*(\\d\\d\\d\\d)[\\.\\-/](\\d\\d)[\\.\\-/](\\d\\d)[\\- 
](\\d\\d)[:\\-\\.](\\d\\d)[:\\-\\.](\\d\\d).*"),
-                            new Fields[] { Fields.year, Fields.month, 
Fields.day, Fields.hour, Fields.minute, Fields.second } );
+        addTimeStampPattern("YYYY[.-/]MM[.-/]DD[- ]hh[:-.]mm[:-.]ss (AP)",
+                            
Pattern.compile(".*(\\d\\d\\d\\d)[\\.\\-/](\\d\\d)[\\.\\-/](\\d\\d)[\\- 
](\\d\\d)[:\\-\\.](\\d\\d)[:\\-\\.](\\d\\d) ?([AP]?M?).*"),
+                            new Fields[] { Fields.year, Fields.month, 
Fields.day, Fields.hour, Fields.minute, Fields.second, Fields.ampm } );
 
         // typical DD.MM.YYYY hh:mm:ss timestamp
-        addTimeStampPattern("DD[.-/]MM[.-/]YYYY[- ]hh[:-.]mm[:-.]ss",
-                            
Pattern.compile(".*(\\d\\d)[\\.\\-/](\\d\\d)[\\.\\-/](\\d\\d\\d\\d)[\\- 
](\\d\\d)[:\\-\\.](\\d\\d)[:\\-\\.](\\d\\d).*"),
-                            new Fields[] { Fields.day, Fields.month, 
Fields.year, Fields.hour, Fields.minute, Fields.second } );
+        addTimeStampPattern("DD[.-/]MM[.-/]YYYY[- ]hh[:-.]mm[:-.]ss (AP)",
+                            
Pattern.compile(".*(\\d\\d)[\\.\\-/](\\d\\d)[\\.\\-/](\\d\\d\\d\\d)[\\- 
](\\d\\d)[:\\-\\.](\\d\\d)[:\\-\\.](\\d\\d) ?([AP]?M?).*"),
+                            new Fields[] { Fields.day, Fields.month, 
Fields.year, Fields.hour, Fields.minute, Fields.second, Fields.ampm } );
         
         // typical YYYY-MM-DD hh:mm:ss.mss timestamp
         addTimeStampPattern("YYYY[.-/]MM[.-/]DD[- 
T]hh[:-.]mm[:-.]ss[:-.,]mss",
@@ -55,25 +66,32 @@
                             Pattern.compile(".*\\w\\w\\w (\\w\\w\\w) 
+(\\d\\d?) (\\d\\d):(\\d\\d):(\\d\\d) [^ ]* *(\\d\\d\\d\\d).*"),
                             new Fields[] { Fields.nameOfMonth, Fields.day, 
Fields.hour, Fields.minute, Fields.second, Fields.year } );
         
+        // I don't know where this pattern came from...
+        addTimeStampPattern("YYYY MON DD hh:mm:ss (AP)",
+                            Pattern.compile(".*(\\d\\d\\d\\d) (\\w\\w\\w) 
+(\\d\\d?) (\\d\\d):(\\d\\d):(\\d\\d) ?([AP]?M?).*"),
+                            new Fields[] { Fields.year, Fields.nameOfMonth, 
Fields.day, Fields.hour, Fields.minute, Fields.second, Fields.ampm } );
+        
+        // WebLogic Log Timestamps
+        addTimeStampPattern("MON DD, YYYY hh:mm:ss (AP)",
+                            Pattern.compile(".*(\\w\\w\\w) +(\\d\\d?), 
(\\d\\d\\d\\d) (\\d\\d?):(\\d\\d):(\\d\\d) ?([AP]?M?) .*"),
+                            new TimeStamp.Fields[] { 
TimeStamp.Fields.nameOfMonth, TimeStamp.Fields.day, TimeStamp.Fields.year, 
+                                                     TimeStamp.Fields.hour, 
TimeStamp.Fields.minute, TimeStamp.Fields.second, TimeStamp.Fields.ampm } );
+
+        // some special tooling
+        addTimeStampPattern("TIME=YYYYMMDDhhmmss",
+                            
Pattern.compile(".*TIME=(\\d\\d\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d).*"),
+                            new Fields[] { Fields.year, Fields.month, 
Fields.day, Fields.hour, Fields.minute, Fields.second } );
+
         // typical MM/DD/YYYY timestamp (like in "sar -u")
         addTimeStampPattern("MM/DD/YYYY",
                             
Pattern.compile(".*(\\d\\d)/(\\d\\d)/(\\d\\d\\d\\d).*"),
                             new Fields[] { Fields.month, Fields.day, 
Fields.year } );
 
         // typical hh:mm:ss timestamp (like in "sar -u")
-        addTimeStampPattern("hh:mm:ss",
-                            
Pattern.compile(".*(\\d\\d):(\\d\\d):(\\d\\d).*"),
-                            new Fields[] { Fields.hour, Fields.minute, 
Fields.second } );
+        addTimeStampPattern("hh:mm:ss (AP)",
+                            Pattern.compile(".*(\\d\\d):(\\d\\d):(\\d\\d) 
?([AP]?M?).*"),
+                            new Fields[] { Fields.hour, Fields.minute, 
Fields.second, Fields.ampm } );
         
-        // I don't know where this pattern came from...
-        addTimeStampPattern("YYYY MON DD hh:mm:ss",
-                            Pattern.compile(".*(\\d\\d\\d\\d) (\\w\\w\\w) 
+(\\d\\d?) (\\d\\d):(\\d\\d):(\\d\\d).*"),
-                            new Fields[] { Fields.year, Fields.nameOfMonth, 
Fields.day, Fields.hour, Fields.minute, Fields.second } );
-
-        // some special tooling
-        addTimeStampPattern("TIME=YYYYMMDDhhmmss",
-                            
Pattern.compile(".*TIME=(\\d\\d\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d).*"),
-                            new Fields[] { Fields.year, Fields.month, 
Fields.day, Fields.hour, Fields.minute, Fields.second } );
     }
     
     public synchronized void addTimeStampPattern(String description, Pattern 
pattern, Fields[] groupOrder) {
@@ -96,6 +114,10 @@
         }
     }
     
+    public void setOnlyTimeStampsWithDate(boolean onlyTsWithDate) {
+        this.onlyTsWithDate = onlyTsWithDate;
+    }
+    
     public synchronized void deleteAllTimeStampPatterns() {
         while (size() > 0) {
             deleteTimeStampPattern(0);
@@ -126,6 +148,22 @@
                 int lastHour = hh;
                 boolean patternWithDay = false;
                 Fields[] fields = getTimeStampGroupOrder(i);
+                if (onlyTsWithDate) {
+                    boolean dateInPattern = false;
+                    for (int j=0; j<fields.length; j++) {
+                        switch(fields[j]) {
+                            case year:
+                            case month:
+                            case nameOfMonth:
+                            case day:
+                                dateInPattern = true;
+                                break;
+                        }
+                    }
+                    if (!dateInPattern) {
+                        continue;
+                    }
+                }
                 for (int g=0; g<m.groupCount(); g++) {
                     if (g < fields.length) {
                         switch(fields[g]) {
@@ -179,6 +217,15 @@
                             case ms:
                                 ms = Integer.parseInt(m.group(g+1));
                                 break;
+                            case ampm:
+                                String aps = m.group(g+1).toLowerCase();
+                                if (aps != null && aps.equals("am") && hh == 
12) {
+                                    hh -= 12;
+                                }
+                                if (aps != null && aps.equals("pm") && hh != 
12) {
+                                    hh += 12;
+                                }
+                                break;
                             case unixms:
                                 set(Long.parseLong(m.group(g+1)));
                                 patternWithDay = true;
@@ -186,7 +233,10 @@
                         }
                     }
                 }
-                if (hh < (lastHour-12) && DD == lastDay &&!patternWithDay) {
+                hh += offHH;
+                mm += offMM;
+                ss += offSS;
+                if (hh < (lastHour-12) && DD == lastDay && !patternWithDay) {
                     // new day (timestamp pattern with only time, no date)
                     // we check if "hh < (lastHour-10)" to make sure that 
slightly unsorted
                     // time data like "23:59:58 -> 00:00:00 -> 23:59:59" 
isn't considered as
Index: src/de/nmichael/pda/data/Quantiles.java
===================================================================
--- src/de/nmichael/pda/data/Quantiles.java     (revision 0)
+++ src/de/nmichael/pda/data/Quantiles.java     (revision 5)
@@ -0,0 +1,44 @@
+/**
+* Title:        Performance Data Analyzer (PDA)
+* Copyright:    Copyright (c) 2007-2012 by Nicolas Michael
+* Website:      http://pda.nmichael.de/
+* License:      GNU General Public License v2
+*
+* @author Nicolas Michael
+* @version 1
+*/
+
+package de.nmichael.pda.data;
+
+import java.util.*;
+
+public class Quantiles  {
+    
+    public static final String Q90 = "q90";
+    public static final String Q95 = "q95";
+    public static final String Q99 = "q99";
+    
+    private Hashtable<String,Float> quantiles = new 
Hashtable<String,Float>();
+    
+    public Quantiles() {
+    }
+    
+    public void add(String key, float value) {
+        quantiles.put(key, value);
+    }
+    
+    public float get(String key) {
+        return quantiles.get(key);
+    }
+    
+    public int size() {
+        return quantiles.size();
+    }
+    
+    public String[] getKeys() {
+        String[] keys = quantiles.keySet().toArray(new String[0]);
+        Arrays.sort(keys);
+        return keys;
+    }
+    
+}
Index: src/de/nmichael/pda/data/ILoadSteps.java
===================================================================
--- src/de/nmichael/pda/data/ILoadSteps.java    (revision 4)
+++ src/de/nmichael/pda/data/ILoadSteps.java    (revision 5)
@@ -18,28 +18,26 @@
     public long getEnd(int step);
     public long getLoad(int step);
     public long getActLoad(int step);
-    public long getTotalRequests(int step);
-    public long getSuccessfulRequests(int step);
-    public long getFailedRequests(int step);
-    public float getRequestFailureRate(int step);
-    public int getNumberOfSegements(int step);
-    public float getRespMin(int step, int segment);
-    public float getRespMax(int step, int segment);
-    public float getRespAvg(int step, int segment);
-    public float getRespQ95(int step, int segment);
-    public float getRespQuantile(int step, int segment, String quantile);
-
+    public long getTotalRequests(int step, String req);
+    public long getSuccessfulRequests(int step, String req);
+    public long getFailedRequests(int step, String req);
+    public float getRequestFailureRate(int step, String req);
+    public String[] getAllRequestNames();
+    public String[] getAllQuantileNames();
+    public float getRespMin(int step, String req);
+    public float getRespMax(int step, String req);
+    public float getRespAvg(int step, String req);
+    public float getRespQuant(int step, String req, String quant);
     public void stepNew(long start);
     public void stepEnd(long end);
     public void stepLoad(long load);
-    public void stepActLoad(long load) ;
-    public void stepTotalRequests(long requests);
-    public void stepSuccessfullRequests(long requests);
-    public void stepFailedRequests(long requests);
-    public void stepRequestFailureRate(float cfr);
-    public void stepRespMin(int segment, float setup);
-    public void stepRespMax(int segment, float setup);
-    public void stepRespAvg(int segment, float setup);
-    public void stepRespQ95(int segment, float setup);
-    
+    public void stepActLoad(long load);
+    public void stepTotalRequests(String req, long cnt);
+    public void stepSuccessfullRequests(String req, long cnt);
+    public void stepFailedRequests(String req, long cnt);
+    public void stepRequestFailureRate(String req, float failureRate);
+    public void stepRespMin(String req, float resp);
+    public void stepRespMax(String req, float resp);
+    public void stepRespAvg(String req, float resp);
+    public void stepRespQ95(String req, String quant, float resp);
 }
Index: src/de/nmichael/pda/data/CategoryGroups.java
===================================================================
--- src/de/nmichael/pda/data/CategoryGroups.java        (revision 4)
+++ src/de/nmichael/pda/data/CategoryGroups.java        (revision 5)
@@ -82,8 +82,10 @@
     }
 
     public DataGroup getGroup(int i) {
-        Logger.log(Logger.LogType.debug, "getGroup(" + i + ")");
-        Logger.log(Logger.LogType.debug, "getGroup(): getNumberOfGroups() == 
" + getNumberOfGroups());
+        if (Logger.isDebugLoggin()) {
+            Logger.log(Logger.LogType.debug, "getGroup(" + i + ")");
+            Logger.log(Logger.LogType.debug, "getGroup(): 
getNumberOfGroups() == " + getNumberOfGroups());
+        }
         if (i < 0 || i >= getNumberOfGroups()) {
             return null;
         }
Index: src/de/nmichael/pda/data/DataSet.java
===================================================================
--- src/de/nmichael/pda/data/DataSet.java       (revision 4)
+++ src/de/nmichael/pda/data/DataSet.java       (revision 5)
@@ -20,6 +20,15 @@
     
     public static final String UNKNOWN = "unknown";
     
+    public static final String PARAM_TIME_OFFSET_HH = "Time Offet [hh]";
+    public static final String PARAM_TIME_OFFSET_MM = "Time Offet [mm]";
+    public static final String PARAM_TIME_OFFSET_SS = "Time Offet [ss]";
+    
+    public static long tsOffset_hours = 0;
+    public static long tsOffset_minutes = 0;
+    public static long tsOffset_secs = 0;
+    protected final Hashtable<String,String> parameters = new 
Hashtable<String,String>();
+    
     private String filename;
     private BufferedReader f;
     private TimeStamp timestamp;
@@ -51,7 +60,10 @@
     
     private void initialize(String name) {
         this.name = name;
-        timestamp = new TimeStamp();
+        setParameter(PARAM_TIME_OFFSET_HH, "0");
+        setParameter(PARAM_TIME_OFFSET_MM, "0");
+        setParameter(PARAM_TIME_OFFSET_SS, "0");
+        timestamp = new TimeStamp(tsOffset_hours, tsOffset_minutes, 
tsOffset_secs);
         //pTSinc = Pattern.compile("Time: (\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d) 
(\\d\\d):(\\d\\d):(\\d\\d).*");
     }
     
@@ -69,6 +81,7 @@
     
     public void parse(String filename) {
         this.filename = filename;
+        timestamp.reset(tsOffset_hours, tsOffset_minutes, tsOffset_secs);
         try {
             f = new BufferedReader(new FileReader(filename));
         } catch(Exception e) {
@@ -88,7 +101,9 @@
     }
     
     public void reparse() {
-        parse(filename);
+        if (filename != null) {
+            parse(filename);
+        }
     }
     
     protected String readLine() {
@@ -123,6 +138,13 @@
         return timestamp;
     }
     
+    protected void setCategorySeriesNames(String[] categoryNames) {
+        this.categoryNames = new ArrayList<String>();
+        for (String cat : categoryNames) {
+            this.categoryNames.add(cat);
+        }        
+    }
+
     protected void setCategorySeriesNames(String[] categoryNames, String[] 
seriesNames) {
         this.categoryNames = new ArrayList<String>();
         this.seriesNames = new Hashtable<String,ArrayList<String>>();
@@ -149,6 +171,17 @@
         }        
     }
     
+    protected void setSeriesNames(String categroy, String[] seriesNames) {
+        ArrayList<String> sNames = new ArrayList<String>();
+        for (String s : seriesNames) {
+            sNames.add(s);
+        }
+        if (this.seriesNames == null) {
+            this.seriesNames = new Hashtable<String,ArrayList<String>>();
+        }
+        this.seriesNames.put(categroy, sNames);
+    }
+    
     private void iniDataStructures() {
         int c = categoryNames.size();
         int s = 0;
@@ -545,6 +578,74 @@
          if (args == null) return "";
          else return args;
      }
+     
+     
+     /**
+      * For Columns with fixed Widths, separated by Strings, get the start 
index of each Column
+      * Example: "           ExecuteQueueRuntime  count  count   count    
count"
+      * returns: [0,         11,                  32,    39,     47,      56 
]
+      * @param s the string 
+      * @return the column positions
+      */
+     protected int[] getColumnPositionsFromString(String s, boolean 
alignedRight) {
+         Vector<Integer> pos = new Vector<Integer>();
+         int step = 0;
+         
+         if (s.length() > 0) {
+             pos.add(0);
+         }
+         
+         for (int i=0; i<s.length(); i++) {
+             if (alignedRight) {
+                 // right aligned
+                 // step=0 - in leading spaces
+                 // step=1 - in characters
+                 if (step == 0 && s.charAt(i) != ' ' && s.charAt(i) != '\t') 
{
+                     step = 1;
+                     continue;
+                 }
+                 if (step == 1 && (s.charAt(i) == ' ' || s.charAt(i) == 
'\t')) {
+                     pos.add(i);
+                     step = 0;
+                 }
+             } else {
+                 // left aligned
+                 // step=0 - in characters
+                 // step=1 - in trailing spaces
+                 if (step == 0 && (s.charAt(i) == ' ' || s.charAt(i) == 
'\t')) {
+                     step = 1;
+                     continue;
+                 }
+                 if (step == 1 && s.charAt(i) != ' ' && s.charAt(i) != '\t') 
{
+                     pos.add(i);
+                     step = 0;
+                 }
+             }
+         }
+         int[] positions = new int[pos.size()];
+         for (int i=0; i<pos.size(); i++) {
+             positions[i] = pos.get(i);
+         }
+         return positions;
+     }
+     
+     protected String[] splitStringByColumns(String s, int[] pos) {
+         if (s == null) {
+             return null;
+         }
+         String[] cols = new String[pos.length];
+         for (int i=0; i<pos.length; i++) {
+             try {
+                 cols[i] = s.substring(pos[i], (i + 1 < pos.length ? pos[i + 
1] : s.length()));
+                 if (cols[i] != null) {
+                     cols[i] = cols[i].trim();
+                 }
+             } catch(Exception e) {
+                 cols[i] = null;
+             }
+         }
+         return cols;
+     }
 
      
      protected void setPreferredScale(int[][] scaleGroups) {
@@ -645,15 +746,42 @@
      }
      
      public String[] getParameterNames() {
-         return null;
+         String[] keys = parameters.keySet().toArray(new String[0]);
+         Arrays.sort(keys);
+         return keys;
      }
      
      public void setParameter(String name, String value) {
-         // nothing to do in default parser (no parameters supported)
+         if (name == null || value == null) {
+             return;
+         }
+         parameters.put(name, value);
+         if (PARAM_TIME_OFFSET_HH.equals(name)) {
+             try {
+                 tsOffset_hours = Long.parseLong(value.trim());
+             } catch(Exception e) {
+                 tsOffset_hours = 0;
+             }
+         }
+         if (PARAM_TIME_OFFSET_MM.equals(name)) {
+             try {
+                 tsOffset_minutes = Long.parseLong(value.trim());
+             } catch(Exception e) {
+                 tsOffset_minutes = 0;
+             }
+         }
+         if (PARAM_TIME_OFFSET_SS.equals(name)) {
+             try {
+                 tsOffset_secs = Long.parseLong(value.trim());
+             } catch(Exception e) {
+                 tsOffset_secs = 0;
+             }
+         }
+         reparse();
      }
 
      public String getParameter(String name) {
-         return null;
+         return parameters.get(name);
      }
 
      public int dropNotSelectedSeries(PropertySet prop, CategoryGroups 
groups) {
@@ -731,5 +859,5 @@
         
         return stat;
     }
-     
+
 }
Index: src/de/nmichael/pda/data/LoadSteps.java
===================================================================
--- src/de/nmichael/pda/data/LoadSteps.java     (revision 4)
+++ src/de/nmichael/pda/data/LoadSteps.java     (revision 5)
@@ -19,19 +19,21 @@
         public long end = 0;
         public long load = 0;
         public long actload = 0;
-        public long totalRequests = 0;
-        public long successfulRequests = 0;
-        public long failedRequests = 0;
-        public float failureRate = 0.0f;
-        public int segments = 0;
-        public Vector setupMin = new Vector();
-        public Vector setupMax = new Vector();
-        public Vector setupAvg = new Vector();
-        public Vector setupQ95 = new Vector();
+        
+        public Hashtable<String,Long> totalRequests = new 
Hashtable<String,Long>();
+        public Hashtable<String,Long> successfulRequests = new 
Hashtable<String,Long>();
+        public Hashtable<String,Long> failedRequests = new 
Hashtable<String,Long>();
+        public Hashtable<String,Float> failureRate = new 
Hashtable<String,Float>();
+        public Hashtable<String,Float> respMin = new 
Hashtable<String,Float>();
+        public Hashtable<String,Float> respMax = new 
Hashtable<String,Float>();
+        public Hashtable<String,Float> respAvg = new 
Hashtable<String,Float>();
+        public Hashtable<String,Quantiles> respQuant = new 
Hashtable<String,Quantiles>();
     }
     
-    private Vector steps = new Vector();
+    private Vector<LoadStep> steps = new Vector<LoadStep>();
     private LoadStep step = null;
+    private Hashtable<String,String> allRequestNames = new 
Hashtable<String,String>();
+    private Hashtable<String,String> allQuantileNames = new 
Hashtable<String,String>();
     
     public LoadSteps(String filename) {
         super(filename);
@@ -47,7 +49,7 @@
     
     public long getStart(int step) {
         try {
-            return ((LoadStep)(steps.get(step))).start;
+            return (steps.get(step)).start;
         } catch(Exception e) {
             return 0;
         }
@@ -55,7 +57,7 @@
     
     public long getEnd(int step) {
         try {
-            return ((LoadStep)(steps.get(step))).end;
+            return (steps.get(step)).end;
         } catch(Exception e) {
             return 0;
         }
@@ -63,7 +65,7 @@
     
     public long getLoad(int step) {
         try {
-            return ((LoadStep)(steps.get(step))).load;
+            return (steps.get(step)).load;
         } catch(Exception e) {
             return 0;
         }
@@ -71,88 +73,96 @@
     
     public long getActLoad(int step) {
         try {
-            return ((LoadStep)(steps.get(step))).actload;
+            return (steps.get(step)).actload;
         } catch(Exception e) {
             return 0;
         }
     }
     
-    public long getTotalRequests(int step) {
+    public long getTotalRequests(int step, String req) {
         try {
-            return ((LoadStep)(steps.get(step))).totalRequests;
+            return (steps.get(step)).totalRequests.get(req);
         } catch(Exception e) {
             return 0;
         }
     }
     
-    public long getSuccessfulRequests(int step) {
+    public long getSuccessfulRequests(int step, String req) {
         try {
-            return ((LoadStep)(steps.get(step))).successfulRequests;
+            return (steps.get(step)).successfulRequests.get(req);
         } catch(Exception e) {
             return 0;
         }
     }
     
-    public long getFailedRequests(int step) {
+    public long getFailedRequests(int step, String req) {
         try {
-            return ((LoadStep)(steps.get(step))).failedRequests;
+            return (steps.get(step)).failedRequests.get(req);
         } catch(Exception e) {
             return 0;
         }
     }
     
-    public float getRequestFailureRate(int step) {
+    public float getRequestFailureRate(int step, String req) {
         try {
-            return ((LoadStep)(steps.get(step))).failureRate;
+            return (steps.get(step)).failureRate.get(req);
         } catch(Exception e) {
             return 0.0f;
         }
     }
     
-    public int getNumberOfSegements(int step) {
+    public String[] getAllRequestNames() {
         try {
-            return ((LoadStep)(steps.get(step))).segments;
+            String[] names = allRequestNames.keySet().toArray(new String[0]);
+            Arrays.sort(names);
+            return names;
         } catch(Exception e) {
-            return 0;
+            return null;
         }
     }
     
-    public float getRespMin(int step, int segment) {
+    public String[] getAllQuantileNames() {
         try {
-            return 
((Float)(((LoadStep)(steps.get(step))).setupMin.get(segment))).floatValue();
+            String[] names = allQuantileNames.keySet().toArray(new 
String[0]);
+            Arrays.sort(names);
+            return names;
         } catch(Exception e) {
+            return null;
+        }
+    }    
+    
+    public float getRespMin(int step, String req) {
+        try {
+            return (steps.get(step)).respMin.get(req);
+        } catch(Exception e) {
             return 0.0f;
         }
     }
     
-    public float getRespMax(int step, int segment) {
+    public float getRespMax(int step, String req) {
         try {
-            return 
((Float)(((LoadStep)(steps.get(step))).setupMax.get(segment))).floatValue();
+            return (steps.get(step)).respMax.get(req);
         } catch(Exception e) {
             return 0.0f;
         }
     }
     
-    public float getRespAvg(int step, int segment) {
+    public float getRespAvg(int step, String req) {
         try {
-            return 
((Float)(((LoadStep)(steps.get(step))).setupAvg.get(segment))).floatValue();
+            return (steps.get(step)).respAvg.get(req);
         } catch(Exception e) {
             return 0.0f;
         }
     }
     
-    public float getRespQ95(int step, int segment) {
+    public float getRespQuant(int step, String req, String quant) {
         try {
-            return 
((Float)(((LoadStep)(steps.get(step))).setupQ95.get(segment))).floatValue();
+            return (steps.get(step)).respQuant.get(req).get(quant);
         } catch(Exception e) {
             return 0.0f;
         }
     }
     
-    public float getRespQuantile(int step, int segment, String quantile) {
-        return 0.0f;
-    }
-    
     public void stepNew(long start) {
         if (step != null) {
             stepEnd(start);
@@ -178,60 +188,57 @@
         step.actload = load;
     }
     
-    public void stepTotalRequests(long requests) {
+    public void stepTotalRequests(String req, long cnt) {
         if (step == null) return;
-        step.totalRequests = requests;
+        step.totalRequests.put(req, cnt);
+        allRequestNames.put(req, "foo");
     }
 
-    public void stepSuccessfullRequests(long requests) {
+    public void stepSuccessfullRequests(String req, long cnt) {
         if (step == null) return;
-        step.successfulRequests = requests;
+        step.successfulRequests.put(req, cnt);
+        allRequestNames.put(req, "foo");
     }
 
-    public void stepFailedRequests(long requests) {
+    public void stepFailedRequests(String req, long cnt) {
         if (step == null) return;
-        step.failedRequests = requests;
+        step.failedRequests.put(req, cnt);
+        allRequestNames.put(req, "foo");
     }
     
-    public void stepRequestFailureRate(float failureRate) {
+    public void stepRequestFailureRate(String req, float failureRate) {
         if (step == null) return;
-        step.failureRate = failureRate;
+        step.failureRate.put(req, failureRate);
+        allRequestNames.put(req, "foo");
     }
     
-    private void insertFloatIntoVector(Vector v, int pos, float val) {
-        while (v.size() < pos) {
-            v.add(new Float(0.0f));
-        }
-        if (v.size() == pos) {
-            v.add(new Float(val));
-        } else {
-            v.remove(pos);
-            v.insertElementAt(new Float(val), pos);
-        }
-    }
-    
-    public void stepRespMin(int segment, float setup) {
+    public void stepRespMin(String req, float resp) {
         if (step == null) return;
-        if (segment > step.segments) step.segments = segment;
-        insertFloatIntoVector(step.setupMin,segment,setup);
+        step.respMin.put(req, resp);
+        allRequestNames.put(req, "foo");
     }
     
-    public void stepRespMax(int segment, float setup) {
+    public void stepRespMax(String req, float resp) {
         if (step == null) return;
-        if (segment > step.segments) step.segments = segment;
-        insertFloatIntoVector(step.setupMax,segment,setup);
+        step.respMax.put(req, resp);
+        allRequestNames.put(req, "foo");
     }
     
-    public void stepRespAvg(int segment, float setup) {
+    public void stepRespAvg(String req, float resp) {
         if (step == null) return;
-        if (segment > step.segments) step.segments = segment;
-        insertFloatIntoVector(step.setupAvg,segment,setup);
+        step.respAvg.put(req, resp);
+        allRequestNames.put(req, "foo");
     }
     
-    public void stepRespQ95(int segment, float setup) {
+    public void stepRespQ95(String req, String quant, float resp) {
         if (step == null) return;
-        if (segment > step.segments) step.segments = segment;
-        insertFloatIntoVector(step.setupQ95,segment,setup);
+        Quantiles q = step.respQuant.get(req);
+        if (q == null) {
+            q = new Quantiles();
+        }
+        step.respQuant.put(req, q);
+        allRequestNames.put(req, "foo");
+        allQuantileNames.put(quant, "foo");
     }
     
 }
Index: src/de/nmichael/pda/parser/FabanDriverStats.java
===================================================================
--- src/de/nmichael/pda/parser/FabanDriverStats.java    (revision 0)
+++ src/de/nmichael/pda/parser/FabanDriverStats.java    (revision 5)
@@ -0,0 +1,120 @@
+/**
+* Title:        Performance Data Analyzer (PDA)
+* Copyright:    Copyright (c) 2007-2012 by Nicolas Michael
+* Website:      http://pda.nmichael.de/
+* License:      GNU General Public License v2
+*
+* @author Nicolas Michael
+* @version 1
+*/
+
+package de.nmichael.pda.parser;
+
+import de.nmichael.pda.data.*;
+import java.util.regex.*;
+import java.util.*;
+import java.io.*;
+
+public class FabanDriverStats extends LoadSteps {
+    
+    private static final int MAX_CATEGORIES = 1024;
+    private Hashtable categoryMapping = new Hashtable();
+    
+    public boolean canHandle(String filename) {
+        return super.canHandle(filename,"driver.log");
+    }
+    
+    public FabanDriverStats() {
+        super("faban");
+        setSupportedFileFormat(new FileFormatDescription(
+                "Faban",
+                null,
+                "driver.log",
+                null,
+                "Faban Driver Statistics Logfile",
+                null));
+    }
+    
+    public void parse() {
+        String[] seriesNames = new String[] { "CThru", "OThru", "CErr", 
"CResp", "OResp", "CSD", "OSD", "C90%Resp", "O90%Resp" };
+        iniDataStructures(MAX_CATEGORIES,seriesNames.length);
+                                  
+        try {
+            String s;
+            Pattern p = Pattern.compile("INFO: [^ ]+ - ([^ ]+): ([^ ]+) 
CThru=([0-9\\.\\-/]+) OThru=([0-9\\.\\-/]+) CErr=([0-9\\.\\-/]+) 
CResp=([0-9\\.\\-/]+) OResp=([0-9\\.\\-/]+) CSD=([0-9\\.\\-/]+) 
OSD=([0-9\\.\\-/]+) C90%Resp=([0-9\\.\\-/]+) O90%Resp=([0-9\\.\\-/]+)");
+            while( (s = readLine()) != null) {
+                Matcher m = p.matcher(s);
+                if (m.matches()) {
+                    long t = getCurrentTimeStamp().getTimeStamp();
+                    String driverName = m.group(1);
+                    StringTokenizer tNameTok   = new 
StringTokenizer(m.group(2), "/");
+                    StringTokenizer cThruTok   = new 
StringTokenizer(m.group(3), "/");
+                    StringTokenizer oThruTok   = new 
StringTokenizer(m.group(4), "/");
+                    StringTokenizer cErrTok    = new 
StringTokenizer(m.group(5), "/");
+                    StringTokenizer cRespTok   = new 
StringTokenizer(m.group(6), "/");
+                    StringTokenizer oRespTok   = new 
StringTokenizer(m.group(7), "/");
+                    StringTokenizer csdTok     = new 
StringTokenizer(m.group(8), "/");
+                    StringTokenizer osdTok     = new 
StringTokenizer(m.group(9), "/");
+                    StringTokenizer c90RespTok = new 
StringTokenizer(m.group(10), "/");
+                    StringTokenizer o90RespTok = new 
StringTokenizer(m.group(11), "/");
+
+                    while (tNameTok.hasMoreTokens()) {
+                        String tName = tNameTok.nextToken();
+                        String cThru = cThruTok.nextToken();
+                        String oThru = oThruTok.nextToken();
+                        String cErr = cErrTok.nextToken();
+                        String cResp = cRespTok.nextToken();
+                        String oResp = oRespTok.nextToken();
+                        String csd = csdTok.nextToken();
+                        String osd = osdTok.nextToken();
+                        String c90Resp = c90RespTok.nextToken();
+                        String o90Resp = o90RespTok.nextToken();
+                        String cat = driverName + ":" + tName;
+                        Integer deviceId = (Integer) 
categoryMapping.get(cat);
+                        if (deviceId == null && categoryMapping.size() < 
MAX_CATEGORIES) {
+                            deviceId = new Integer(categoryMapping.size());
+                            categoryMapping.put(cat, deviceId);
+                        }
+                        if (deviceId != null) {
+                            int c = deviceId.intValue();
+                            try { addSample(c, 0, new SampleFloat(t, 
Float.parseFloat(cThru))); } catch(Exception eignore) {}
+                            try { addSample(c, 1, new SampleFloat(t, 
Float.parseFloat(oThru))); } catch(Exception eignore) {}
+                            try { addSample(c, 2, new SampleFloat(t, 
Float.parseFloat(cErr))); } catch(Exception eignore) {}
+                            try { addSample(c, 3, new SampleFloat(t, 
Float.parseFloat(cResp))); } catch(Exception eignore) {}
+                            try { addSample(c, 4, new SampleFloat(t, 
Float.parseFloat(oResp))); } catch(Exception eignore) {}
+                            try { addSample(c, 5, new SampleFloat(t, 
Float.parseFloat(csd))); } catch(Exception eignore) {}
+                            try { addSample(c, 6, new SampleFloat(t, 
Float.parseFloat(osd))); } catch(Exception eignore) {}
+                            try { addSample(c, 7, new SampleFloat(t, 
Float.parseFloat(c90Resp))); } catch(Exception eignore) {}
+                            try { addSample(c, 8, new SampleFloat(t, 
Float.parseFloat(o90Resp))); } catch(Exception eignore) {}
+                        }
+                    }
+                }
+            }
+            Object[] categories = categoryMapping.keySet().toArray();
+            Arrays.sort(categories);
+            String[] categoryNames = new String[categories.length];
+            int[] orgIndices = new int[categories.length];
+            for (int i=0; i<categoryNames.length; i++) {
+                orgIndices[i] = 
((Integer)categoryMapping.get(categories[i])).intValue();
+                categoryNames[i] = (String)categories[i];
+            }
+            setCategorySeriesNames(categoryNames, seriesNames);
+            reorganizeCategoryIndices(orgIndices);
+            
+            int[] scaleGroupSeries = new int[seriesNames.length];
+            scaleGroupSeries[0] = scaleGroupSeries[1] = 0;
+            scaleGroupSeries[2] = 1;
+            scaleGroupSeries[3] = scaleGroupSeries[4] = 2;
+            scaleGroupSeries[5] = scaleGroupSeries[6] = 3;
+            scaleGroupSeries[7] = scaleGroupSeries[8] = 2;
+            int[][] scaleGroup = new int[this.getNumberOfCategories()][];
+            for (int i=0; i<scaleGroup.length; i++) {
+                scaleGroup[i] = scaleGroupSeries;
+            }
+            setPreferredScale(scaleGroup);
+        } catch(Exception e) {
+            logError(e.toString());
+        }
+    }
+    
+}
Index: src/de/nmichael/pda/parser/Iostat.java
===================================================================
--- src/de/nmichael/pda/parser/Iostat.java      (revision 4)
+++ src/de/nmichael/pda/parser/Iostat.java      (revision 5)
@@ -17,13 +17,11 @@
 
 public class Iostat extends DataSet {
     
+    private static final String PARAM_ALLOW_DUPLICATE_DISKS = "Allow 
duplicate (identical) Disk Names";
     private static final int MAX_DEVICES = 1024;
     private Hashtable deviceMapping = new Hashtable();
 
     private static boolean _duplicateDisks = false;
-    private static final String[] parameters = { 
-        "Allow duplicate (identical) Disk Names"
-    };
     
     public boolean canHandle(String filename) {
         return super.canHandle(filename,"iostat");
@@ -162,33 +160,16 @@
         }
     }
   
-     public String[] getParameterNames() {
-         return parameters;
-     }
+    public void setParameter(String name, String value) {
+        super.setParameter(name, value);
+        if (PARAM_ALLOW_DUPLICATE_DISKS.equals(name)) {
+            try {
+                _duplicateDisks = Boolean.parseBoolean(value);
+                reparse();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
      
-     public void setParameter(String name, String value) {
-         if (name == null) ret
[truncated due to length]



[perfdata~pda:5] Bugfixes and Parser Enhancements

nicolasmichael 03/29/2012
 
 
Close
loading
Please Confirm
Close