Package org.adoptopenjdk.jitwatch.ui

Source Code of org.adoptopenjdk.jitwatch.ui.StatsStage

/*
* Copyright (c) 2013, 2014 Chris Newland.
* Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD
* Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki
*/
package org.adoptopenjdk.jitwatch.ui;

import org.adoptopenjdk.jitwatch.model.JITStats;

import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.TableView;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.WindowEvent;

public class StatsStage extends Stage
{
  private TableView<StatsTableRow> tableView;
  private ObservableList<StatsTableRow> obList = FXCollections.observableArrayList();
 
  private JITWatchUI parent;
 
  public StatsStage(final JITWatchUI parent)
  {
    initStyle(StageStyle.DECORATED);
 
    this.parent = parent;
   
    VBox vbox = new VBox();
   
    Scene scene = new Scene(vbox, 800, 480);
 
    tableView = TableUtil.buildTableStats(obList);
   
    vbox.getChildren().add(tableView);
   
    tableView.prefHeightProperty().bind(scene.heightProperty());

    setTitle("JITWatch Method Statistics");
   
    setScene(scene);
   
    redraw();

    setOnCloseRequest(new EventHandler<WindowEvent>()
    {
      @Override
      public void handle(WindowEvent arg0)
      {
        parent.handleStageClosed(StatsStage.this);
      }
    });
  }
 
  public final void redraw()
  {
    obList.clear();
   
    JITStats stats = parent.getJITDataModel().getJITStats();
   
    obList.add(makeRow("Public methods compiled", stats.getCountPublic()));
    obList.add(makeRow("Private methods compiled", stats.getCountPrivate()));
    obList.add(makeRow("Protected methods compiled", stats.getCountProtected()));
    obList.add(makeRow("Static methods compiled", stats.getCountStatic()));
    obList.add(makeRow("Final methods compiled", stats.getCountFinal()));
    obList.add(makeRow("Synchronized methods compiled", stats.getCountSynchronized()));
    obList.add(makeRow("Strictfp methods compiled", stats.getCountStrictfp()));
    obList.add(makeRow("Native methods compiled", stats.getCountNative()));

    obList.add(makeRow("C1 Compiled", stats.getCountC1()));
    obList.add(makeRow("C2 Compiled", stats.getCountC2()));
    obList.add(makeRow("OSR Compiled", stats.getCountOSR()));
    obList.add(makeRow("C2N Compiled", stats.getCountC2N()));
    obList.add(makeRow("Compiler Threads", stats.getCountCompilerThreads()));
   
   
    // * = Only have the queued timestamp and compiled timestamp
    // JIT Time assumes the entire interval was spent compiling
    obList.add(makeRow("Total JIT Time*", stats.getTotalCompileTime()));
   
   
    obList.add(makeRow("Native bytes generated", stats.getNativeBytes()));   

    obList.add(makeRow("Loaded Classes", stats.getCountClass()));   
    obList.add(makeRow("Total Methods Loaded", stats.getCountMethod()));   
    obList.add(makeRow("Total Constructors Loaded", stats.getCountConstructor()));   
  }
 
  private StatsTableRow makeRow(String name, long value)
  {
    return new StatsTableRow(name, value);
  }
}
TOP

Related Classes of org.adoptopenjdk.jitwatch.ui.StatsStage

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.