geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [5/7] incubator-geode git commit: GEODE-78: Imported jvsdfx-mm from geode-1.0.0-SNAPSHOT-2.src.tar
Date Mon, 06 Jul 2015 21:46:47 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e299ea84/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/HoveredThresholdNode.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/HoveredThresholdNode.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/HoveredThresholdNode.java
new file mode 100644
index 0000000..cb3a4cd
--- /dev/null
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/HoveredThresholdNode.java
@@ -0,0 +1,33 @@
+package com.pivotal.jvsd.fx;
+
+import javafx.scene.Cursor;
+import javafx.scene.control.Label;
+import javafx.scene.layout.StackPane;
+
+public class HoveredThresholdNode extends StackPane {
+  public HoveredThresholdNode(String labelString) {
+    setPrefSize(2, 2);
+
+    final Label label = createDataThresholdLabel(labelString);
+
+    setOnMouseEntered(mouseEvent -> {
+      getChildren().setAll(label);
+      setCursor(Cursor.NONE);
+      toFront();
+    });
+    setOnMouseExited(mouseEvent -> {
+      getChildren().clear();
+      setCursor(Cursor.CROSSHAIR);
+    });
+  }
+
+  private Label createDataThresholdLabel(String labelString) {
+    final Label label = new Label(labelString);
+    // TODO style, colors, etc.
+    label.getStyleClass().addAll("chart-line-symbol", "chart-series-line");
+    label.setStyle("-fx-font-size: 8pt;");
+
+    label.setMinSize(Label.USE_PREF_SIZE, Label.USE_PREF_SIZE);
+    return label;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e299ea84/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/LongDoubleMemoryMappedSeries.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/LongDoubleMemoryMappedSeries.java
b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/LongDoubleMemoryMappedSeries.java
new file mode 100644
index 0000000..939152c
--- /dev/null
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/LongDoubleMemoryMappedSeries.java
@@ -0,0 +1,98 @@
+package com.pivotal.jvsd.fx;
+
+import java.nio.ByteBuffer;
+
+import com.pivotal.javafx.scene.chart.ByteBufferNumberSeries;
+import com.pivotal.javafx.scene.chart.Data;
+
+import javafx.collections.ObservableList;
+
+/**
+ * A named series of data items
+ */
+public class LongDoubleMemoryMappedSeries extends ByteBufferNumberSeries<Number, Number>
{
+
+  // -------------- CONSTRUCTORS ----------------------------------------------
+
+  /**
+   * Construct a empty series
+   */
+  public LongDoubleMemoryMappedSeries() {
+    super();
+  }
+
+  /**
+   * Constructs a Series and populates it with the given {@link ObservableList}
+   * data.
+   *
+   * @param data
+   *          ObservableList of MultiAxisChart.Data
+   */
+  public LongDoubleMemoryMappedSeries(ByteBuffer buffer) {
+    super(buffer);
+  }
+
+  /**
+   * Constructs a named Series and populates it with the given
+   * {@link ObservableList} data.
+   *
+   * @param name
+   *          a name for the series
+   * @param data
+   *          ObservableList of MultiAxisChart.Data
+   */
+  public LongDoubleMemoryMappedSeries(String name, ByteBuffer buffer) {
+    super(name, buffer);
+  }
+
+  // BEGIN FORMAT SPECIFIC
+  private static final int DATA_X_OFFSET = 0;
+  private static final int DATA_X_LENGTH = 8;
+  private static final int DATA_Y_OFFSET = DATA_X_OFFSET + DATA_X_LENGTH;
+  private static final int DATA_Y_LENGTH = 8;
+  private static final int DATA_WIDTH = DATA_Y_OFFSET + DATA_Y_LENGTH;
+  
+  // TODO Make these Abstract
+  @Override
+  public int getDataSize() {
+    return getBuffer().limit() / DATA_WIDTH;
+  }
+  
+  // TODO Make these Abstract
+  private long getXRaw(final int index) {
+    return buffer.getLong(index * DATA_WIDTH + DATA_X_OFFSET);
+  }
+
+  // TODO Make these Abstract
+  private double getYRaw(final int index) {
+    return buffer.getDouble(index * DATA_WIDTH + DATA_Y_OFFSET);
+  }
+
+  // END FORMAT SPECIFIC
+ 
+  @Override
+  final protected Data<Number,Number> createData(int index) {
+    return new Data<>(getXRaw(index), getYRaw(index));
+  };
+    
+  @Override
+  final protected Long convertX(final double x) {
+    return (long) x;
+  }
+  
+  @Override
+  final protected Double convertY(final double y) {
+    return y;
+  }
+
+  @Override
+  final protected double getX(final int index) {
+    return (double) getXRaw(index);
+  };
+
+  @Override
+  final protected double getY(final int index) {
+    return (double) getYRaw(index);
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e299ea84/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java
new file mode 100644
index 0000000..cd4c7f7
--- /dev/null
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java
@@ -0,0 +1,44 @@
+package com.pivotal.jvsd.fx;
+
+import com.pivotal.jvsd.controller.RootController;
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.layout.Pane;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+
+/**
+ * @author Jens Deppe
+ */
+public class Main extends Application {
+
+  private Stage primaryStage;
+
+  private RootController controller;
+
+  @Override
+  public void start(Stage stage) throws IOException {
+    primaryStage = stage;
+    primaryStage.setTitle("jVSD");
+
+    FXMLLoader loader = new FXMLLoader(getClass().getResource("/jvsd.fxml"));
+    Pane rootLayout = loader.load();
+
+    Scene scene = new Scene(rootLayout);
+    scene.getStylesheets().add("/jvsd.css");
+
+    controller = loader.getController();
+
+    ChartManager.getInstance().setRootController(controller);
+
+    primaryStage.setScene(scene);
+    primaryStage.show();
+  }
+
+  public static void main(String[] args) throws IOException {
+    StatFileManager.getInstance().add(args);
+    launch(args);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e299ea84/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableByteBuffer.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableByteBuffer.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableByteBuffer.java
new file mode 100644
index 0000000..1f399b1
--- /dev/null
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableByteBuffer.java
@@ -0,0 +1,5 @@
+package com.pivotal.jvsd.fx;
+
+public class ObservableByteBuffer {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e299ea84/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableDataBuffer.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableDataBuffer.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableDataBuffer.java
new file mode 100644
index 0000000..5d2cac5
--- /dev/null
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/ObservableDataBuffer.java
@@ -0,0 +1,31 @@
+package com.pivotal.jvsd.fx;
+
+import java.nio.ByteBuffer;
+import java.util.Observer;
+
+import com.pivotal.javafx.scene.chart.Data;
+
+import javafx.collections.ObservableListBase;
+
+public class ObservableDataBuffer<X, Y> extends ObservableListBase<Data<X, Y>>
{
+
+  @Override
+  public Data<X, Y> get(int index) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+  
+  @Override
+  public boolean add(Data<X, Y> e) {
+    
+    
+    return true;
+  }
+
+  @Override
+  public int size() {
+    // TODO Auto-generated method stub
+    return 0;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e299ea84/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java
new file mode 100644
index 0000000..17fc41a
--- /dev/null
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java
@@ -0,0 +1,37 @@
+package com.pivotal.jvsd.fx;
+
+import com.pivotal.jvsd.model.stats.StatArchiveFile;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Basic container for all stat files we are managing.
+ *
+ * @author Jens Deppe
+ */
+public class StatFileManager {
+
+  private List<StatArchiveFile> statFiles = new ArrayList<>();
+
+  private static StatFileManager instance = new StatFileManager();
+
+  private StatFileManager() {
+    // We are a singleton
+  }
+
+  public static StatFileManager getInstance() {
+    return instance;
+  }
+
+  public void add(String[] fileNames) throws IOException {
+    for (String name : fileNames) {
+      statFiles.add(new StatArchiveFile(name));
+    }
+  }
+
+  public List<StatArchiveFile> getArchives() {
+    return statFiles;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e299ea84/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VSDChartWindow.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VSDChartWindow.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VSDChartWindow.java
new file mode 100644
index 0000000..0205a42
--- /dev/null
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VSDChartWindow.java
@@ -0,0 +1,289 @@
+package com.pivotal.jvsd.fx;
+
+import java.io.File;
+
+import javafx.scene.Group;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+import javafx.animation.Animation;
+import javafx.animation.KeyFrame;
+import javafx.animation.Timeline;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.scene.chart.LineChart;
+import javafx.scene.chart.NumberAxis;
+import javafx.scene.chart.XYChart;
+import javafx.util.Duration;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.net.URL;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+import java.text.DateFormat;
+import java.text.NumberFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.ResourceBundle;
+
+import javafx.beans.binding.Bindings;
+import javafx.collections.FXCollections;
+import javafx.fxml.FXML;
+import javafx.fxml.Initializable;
+import javafx.geometry.Side;
+import javafx.scene.chart.Axis;
+import javafx.scene.chart.NumberAxis;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.layout.Pane;
+import javafx.stage.Stage;
+
+import com.pivotal.chart.AdvancedLineChart;
+import com.pivotal.javafx.scene.chart.BasicSeries;
+import com.pivotal.javafx.scene.chart.Data;
+import com.pivotal.javafx.scene.chart.DateAxis;
+import com.pivotal.jvsd.model.stats.StatArchiveFile.StatValue;
+import com.pivotal.jvsd.stats.Utility;
+
+/**
+ * An advanced line chart with a variety of actions and settable properties.
+ *
+ * @see javafx.scene.chart.LineChart
+ * @see javafx.scene.chart.Chart
+ * @see javafx.scene.chart.NumberAxis
+ * @see javafx.scene.chart.XYChart
+ */
+public class VSDChartWindow implements Initializable {
+
+  private int chartId;
+
+  private Stage stage;
+
+  private AdvancedLineChart<Number, Number> chart;
+
+  private ChartManager manager = ChartManager.getInstance();
+
+  @FXML
+  private Pane root;
+
+  @FXML
+  private Button resetButton;
+
+  @FXML
+  private Label coordLabel;
+
+  public void setStage(Stage stage) {
+    this.stage = stage;
+    this.stage.setOnCloseRequest(eh -> {
+      manager.removeChart(chartId);
+    });
+  }
+
+  public void setId(int chartId) {
+    this.chartId = chartId;
+  }
+
+  @Override
+  public void initialize(URL url, ResourceBundle resourceBundle) {
+    chart = createChart(root);
+    root.getChildren().add(chart);
+
+    // TODO better way to do this?
+    coordLabel.textProperty().bind(Bindings.format("%s x %s",
+        Bindings.createStringBinding(() -> DateFormat.getInstance().format(
+                chart.getXAxis().getValueForDisplay(
+                    chart.crosshairXProperty().doubleValue())),
+            chart.crosshairXProperty()),
+        Bindings.createStringBinding(() -> {
+          final NumberFormat formatter = NumberFormat.getInstance();
+          formatter.setGroupingUsed(true);
+          return formatter.format(
+              chart.getPrimaryYAxis().getValueForDisplay(
+                  chart.crosshairYProperty().doubleValue()));
+        }, chart.crosshairYProperty(), chart.primaryYAxisProperty())));
+  }
+
+  @FXML
+  private void resetRangeClicked() {
+    chart.getXAxis().setAutoRanging(true);
+    for (Axis<Number> yAxis : chart.getYAxes()) {
+      yAxis.setAutoRanging(true);
+    }
+  }
+
+  protected AdvancedLineChart<Number, Number> createChart(Pane root) {
+    final DateAxis xAxis = new DateAxis();
+    xAxis.setAutoRanging(true);
+    final NumberAxis yAxis = new NumberAxis();
+    final AdvancedLineChart<Number, Number> lc =
+        new AdvancedLineChart<>(xAxis, yAxis);
+    lc.setCreateSymbols(false);
+    lc.prefWidthProperty().bind(root.widthProperty());
+    lc.prefHeightProperty().bind(root.heightProperty());
+
+    if (ChartManager.MMTEST) {
+//    
+//    try (final RandomAccessFile memoryMappedFile = new RandomAccessFile("/tmp/test.vsd.stat1.vss",
"rw")) {
+//
+//      final MappedByteBuffer in = memoryMappedFile.getChannel().map(FileChannel.MapMode.READ_ONLY,
0, memoryMappedFile.length());
+////      in.limit(1000000);
+//      final LongDoubleMemoryMappedSeries s = new LongDoubleMemoryMappedSeries(in);
+//      lc.getData().add(s);
+//
+////      Timeline animation = new Timeline();
+////      animation.getKeyFrames().add(new KeyFrame(Duration.seconds(1), actionEvent ->
{
+////          in.limit(in.limit()+16);
+////          System.out.println(in.limit());
+//////          lc.toFront();
+//////          Data<Number, Number> last = s.getData().get(s.getData().size() - 1);
+//////          s.getData().add(new Data<>(last.getXValue().longValue() + 1000, last.getYValue().doubleValue()
+ (new Random().nextDouble() * 1000) - 500));
+////        
+////      }));
+////     animation.setCycleCount(Animation.INDEFINITE);
+////     animation.play();
+//      
+//
+//    } catch (FileNotFoundException e) {
+//      // TODO Auto-generated catch block
+//      e.printStackTrace();
+//    } catch (IOException e) {
+//      // TODO Auto-generated catch block
+//      e.printStackTrace();
+//    }
+    
+    }
+
+//  lc.getData().add(new LongDoubleFileSeries(new File("/tmp/test.vsd.stat1.vss")));
+
+    return lc;
+  }
+
+  public void addToChart(StatValue sv) {
+    if (!stage.titleProperty().isBound()) {
+      stage.setTitle(
+          "Chart" + chartId + "_" + sv.getDescriptor().getName());
+    }
+
+    Axis<Number> yAxis;
+    final String units = sv.getDescriptor().getUnits();
+    yAxis = findOrCreateYAxis(units);
+
+    final long[] timestamps = sv.getRawAbsoluteTimeStamps();
+    final double[] values = sv.getRawSnapshots();
+
+    long timeSampleAverage = Utility.computeTimeSampleAverage(timestamps);
+    long samplePeriod = timeSampleAverage / 1000;
+
+    final List<Data<Number, Number>> data; 
+    switch (sv.getFilter()) {
+    case StatValue.FILTER_NONE:
+      data = doFilterNone(samplePeriod, timestamps, values);
+      break;
+    case StatValue.FILTER_PERSEC:
+      data = doFilterPerSec(samplePeriod, timestamps, values);
+      break;
+    default:
+      data = null;
+    }
+
+    // add series data
+    if (ChartManager.MMTEST) {
+      addToChartMM(sv, yAxis, data);
+    } else {
+      BasicSeries<Number, Number> series = new BasicSeries<>(FXCollections.observableList(data));
+      series.setYAxis(yAxis);
+      series.setName(sv.getDescriptor().getName());
+      chart.getData().add(series);
+    }
+  }
+
+  private void addToChartMM(StatValue sv, Axis<Number> yAxis, List<Data<Number,
Number>> data) {
+    try {
+      final File tmp = File.createTempFile(sv.getDescriptor().getName(), ".vss");
+      tmp.deleteOnExit();
+      
+      try (final RandomAccessFile memoryMappedFile = new RandomAccessFile(tmp, "rw")) {
+        final MappedByteBuffer out = memoryMappedFile.getChannel().map(FileChannel.MapMode.READ_WRITE,
0, data.size() * 16);
+
+        for (Data<Number, Number> d : data) {
+          out.putLong(d.getXValue().longValue());
+          out.putDouble(d.getYValue().doubleValue());
+        }
+        out.force();
+
+        final LongDoubleMemoryMappedSeries s = new LongDoubleMemoryMappedSeries(out);
+        s.setYAxis(yAxis);
+        s.setName(sv.getDescriptor().getName());
+        chart.getData().add(s);
+      }
+    } catch (IOException e) {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+    }
+  }
+
+  protected List<Data<Number, Number>> doFilterNone(long samplePeriod, final
long[] timestamps, final double[] values) {
+    final ArrayList<Data<Number, Number>> list = new ArrayList<>(timestamps.length
- 1);
+    final NumberFormat numberFormat = NumberFormat.getInstance();
+    
+    // skip first value to calc value/s.
+    for (int i = 1; i < timestamps.length; i++) {
+      final Data<Number, Number> data = new Data<Number, Number>(timestamps[i],
values[i]);
+
+//TODO speed up      data.setNode(new HoveredThresholdNode(numberFormat.format(values[i])));
+      list.add(data);
+    }
+    
+    return list;
+  }
+
+  protected List<Data<Number, Number>> doFilterPerSec(long samplePeriod, final
long[] timestamps, final double[] values) {
+    final ArrayList<Data<Number, Number>> list = new ArrayList<>(timestamps.length
- 1);
+    final NumberFormat numberFormat = NumberFormat.getInstance();
+    
+    // skip first value to calc value/s.
+    for (int i = 1; i < timestamps.length; i++) {
+      final long timestamp = timestamps[i];
+      final double psValue = Utility.computePerSecondValue(timestamp, timestamps[i - 1],
values[i], values[i - 1], samplePeriod);
+      final Data<Number, Number> data = new Data<Number, Number>(timestamp, psValue);
+
+//TODO speed up      data.setNode(new HoveredThresholdNode(numberFormat.format(psValue)));
+      list.add(data);
+    }
+    
+    return list;
+  }
+
+  private Axis<Number> findOrCreateYAxis(final String units) {
+    Axis<Number> yAxis = findYAxis(units);
+
+    if (null == yAxis) {
+      yAxis = new NumberAxis();
+      yAxis.setSide(Side.RIGHT);
+      chart.getYAxes().add(yAxis);
+    }
+
+    if (null == yAxis.getLabel()) {
+      yAxis.setLabel(units);
+    }
+
+    return yAxis;
+  }
+
+  private Axis<Number> findYAxis(final String units) {
+    for (Axis<Number> y : chart.getYAxes()) {
+      if (null == y.getLabel() || y.getLabel().equals(units)) {
+        return y;
+      }
+    }
+
+    return null;
+  }
+
+
+  public String getTitle() {
+    return stage.getTitle();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e299ea84/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VsdSeries.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VsdSeries.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VsdSeries.java
new file mode 100644
index 0000000..9b1f8ff
--- /dev/null
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/VsdSeries.java
@@ -0,0 +1,37 @@
+package com.pivotal.jvsd.fx;
+
+import java.nio.MappedByteBuffer;
+import java.util.Observable;
+import java.util.Observer;
+
+public class VsdSeries  {
+  // TODO concurrency
+  
+  private MappedByteBuffer buffer = null;
+  
+  private int length = 0;
+  
+  
+  
+  
+  public void addData(long time, double value) {
+    if (buffer.remaining() < 8) {
+      expandBuffer();
+    }
+    
+    buffer.putLong(time);
+    buffer.putDouble(value);
+    length++;
+    
+    // TODO notify change
+  }
+
+  public int getLength() {
+    return length;
+  }
+
+  private void expandBuffer() {
+    // TODO Auto-generated method stub
+    
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e299ea84/jvsdfx-mm/src/main/java/com/pivotal/jvsd/model/ResourceWrapper.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/model/ResourceWrapper.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/model/ResourceWrapper.java
new file mode 100644
index 0000000..5811b9d
--- /dev/null
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/model/ResourceWrapper.java
@@ -0,0 +1,57 @@
+package com.pivotal.jvsd.model;
+
+import com.pivotal.jvsd.model.stats.StatArchiveFile;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+* @author Jens Deppe
+*/
+public class ResourceWrapper {
+  private int row;
+
+  private StatArchiveFile.ResourceInst inst;
+
+  public ResourceWrapper(StatArchiveFile.ResourceInst inst, int idx) {
+    this.inst = inst;
+    this.row = idx;
+  }
+
+  public int getRow() {
+    return row;
+  }
+
+  public Date getStartTime() {
+    return new Date(inst.getFirstTimeMillis());
+  }
+
+  public int getSamples() {
+    return inst.getSampleCount();
+  }
+
+  public String getType() {
+    return inst.getType().getName();
+  }
+
+  public String getName() {
+    return inst.getName();
+  }
+
+  public List<String> getStatNames() {
+    List<String> statNames = new ArrayList<>();
+
+    for (StatArchiveFile.StatValue sv : inst.getStatValues()) {
+      if (!(sv.getSnapshotsAverage() == 0 && sv.getSnapshotsMaximum() == 0 &&
sv.
+          getSnapshotsMinimum() == 0)) {
+        statNames.add(sv.getDescriptor().getName());
+      }
+    }
+    return statNames;
+  }
+
+  public StatArchiveFile.StatValue getStatValue(String name) {
+    return inst.getStatValue(name);
+  }
+}


Mime
View raw message