changeset 21173:12a32123be43

Add info message about time spent parsing files
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Fri, 01 May 2015 16:51:47 -0700
parents 8c0413281551
children d5c1f00373c7
files src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/ImportAction.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/ImportAction.java	Fri May 01 15:58:57 2015 -0700
+++ b/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/ImportAction.java	Fri May 01 16:51:47 2015 -0700
@@ -37,6 +37,8 @@
 import java.io.IOException;
 import java.nio.channels.FileChannel;
 import java.nio.file.StandardOpenOption;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.swing.JFileChooser;
 import javax.swing.SwingUtilities;
 import javax.swing.filechooser.FileFilter;
@@ -94,7 +96,7 @@
         fc.setCurrentDirectory(new File(Settings.get().get(Settings.DIRECTORY, Settings.DIRECTORY_DEFAULT)));
 
         if (fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
-            File file = fc.getSelectedFile();
+            final File file = fc.getSelectedFile();
 
             File dir = file;
             if (!dir.isDirectory()) {
@@ -106,6 +108,7 @@
                 final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.READ);
                 final ProgressHandle handle = ProgressHandleFactory.createHandle("Opening file " + file.getName());
                 handle.start(WORKUNITS);
+                final long startTime = System.currentTimeMillis();
                 final long start = channel.size();
                 ParseMonitor monitor = new ParseMonitor() {
                     @Override
@@ -149,6 +152,8 @@
                             Exceptions.printStackTrace(ex);
                         }
                         handle.finish();
+                        long stop = System.currentTimeMillis();
+                        Logger.getLogger(getClass().getName()).log(Level.INFO, "Loaded in " + file + " in " + ((stop - startTime) / 1000.0) + " seconds");
                     }
                 });
             } catch (FileNotFoundException ex) {