changeset 1565:aea807833d5f

Remove a leftover shutdown hook Reviewed-by: neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2014-November/011643.html
author Omair Majid <omajid@redhat.com>
date Mon, 24 Nov 2014 13:12:49 -0500
parents 6a6dbf86e717
children cc2c360fe1ec
files vm-profiler/jvm-agent/src/main/java/com/redhat/thermostat/vm/profiler/agent/jvm/InstrumentationControl.java vm-profiler/jvm-agent/src/main/java/com/redhat/thermostat/vm/profiler/agent/jvm/Main.java
diffstat 2 files changed, 0 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/vm-profiler/jvm-agent/src/main/java/com/redhat/thermostat/vm/profiler/agent/jvm/InstrumentationControl.java	Mon Nov 24 13:12:49 2014 -0500
+++ b/vm-profiler/jvm-agent/src/main/java/com/redhat/thermostat/vm/profiler/agent/jvm/InstrumentationControl.java	Mon Nov 24 13:12:49 2014 -0500
@@ -68,27 +68,6 @@
         this.classInstrumentor = new AsmBasedInstrumentor();
     }
 
-    void initialize() {
-        addShutdownHookToPrintStatsOnEnd();
-    }
-
-    private void addShutdownHookToPrintStatsOnEnd() {
-        System.out.println("AGENT: adding shutdown hooks");
-        Runtime.getRuntime().addShutdownHook(new Thread() {
-            @Override
-            public void run() {
-                System.out.println("=====");
-                System.out.println("Collected stats");
-                System.out.format("%15s\t%s%n", "Total time (ns)", "Method");
-                Map<String, AtomicLong> data = ProfileRecorder.getInstance().getData();
-                for (Map.Entry<String, AtomicLong> entry : data.entrySet()) {
-                    System.out.format("%15d\t%s%n", entry.getValue().get(), entry.getKey());
-                }
-                System.out.println("=====");
-            }
-        });
-    }
-
     @Override
     public void startProfiling() {
         System.out.println("AGENT: startProfiling()");
--- a/vm-profiler/jvm-agent/src/main/java/com/redhat/thermostat/vm/profiler/agent/jvm/Main.java	Mon Nov 24 13:12:49 2014 -0500
+++ b/vm-profiler/jvm-agent/src/main/java/com/redhat/thermostat/vm/profiler/agent/jvm/Main.java	Mon Nov 24 13:12:49 2014 -0500
@@ -60,7 +60,6 @@
         // System.out.println("AGENT: My classloader is " + this.getClass().getClassLoader());
 
         InstrumentationControl control = new InstrumentationControl(instrumentation);
-        control.initialize();
         try {
             ObjectName name = new ObjectName("com.redhat.thermostat:type=InstrumentationControl");
             server.registerMBean(control, name);