Coder Social home page Coder Social logo

command line only mode about gcviewer HOT 5 OPEN

chewiebug avatar chewiebug commented on June 22, 2024
command line only mode

from gcviewer.

Comments (5)

nsureshn avatar nsureshn commented on June 22, 2024

This mode should include the feature of exporting the graph (as image - GIF/PNG) in addition to CSV data.

from gcviewer.

thierry-feltin avatar thierry-feltin commented on June 22, 2024

Command line mode should not not depend on any GUI component to run : That is should be able to run in a non interative session/shell. This would allow to use it in automated builds/test suites.

from gcviewer.

chewiebug avatar chewiebug commented on June 22, 2024

I agree.

from gcviewer.

dleborgne avatar dleborgne commented on June 22, 2024

I have a java class that takes a gc.log filename and prints some information (throughput, max used mem after gc, total gc'ed mem) on System.out using GCViewer classes. Here is my source code :

import com.tagtraum.perf.gcviewer.*;
import java.io.FileInputStream; 
import java.io.File;
import java.util.logging.Logger;
import java.util.logging.Level; 
import java.util.Locale;

public class GCLogStatistics {

    private final GCLogStatistics i = null; 
    private static final DataReaderFactory factory = new DataReaderFactory();

    public static void main (String args[]) {

        if (args == null || args.length != 1) { 
            System.out.println("Usage: GCLogStatistics gc.log");
            return; 
        }

        GCLogStatistics i = new GCLogStatistics(args[0]);
    }

    GCLogStatistics(String filename) {
        
        try {
            final File f = new File(filename);
            final FileInputStream in = new FileInputStream(f);
            final DataReader reader = factory.getDataReader(in);
            final GCModel model = reader.read();

            System.out.printf(Locale.US,"THROUGHPUT:%2.2f\n",model.getThroughput());
            System.out.println("MAXUSEDMEM:"+model.getPostFullGCUsedMemory().getMax()); 
            System.out.println("TOTALGCEDMEM:"+model.getFreedMemory()); 

        } catch (Exception e ) {
            System.err.println (e.toString ()); 
        }
    }
    
}

from gcviewer.

chewiebug avatar chewiebug commented on June 22, 2024

Hi David,

Thank you for this sample. There is another user working on this issue (pbilstein). His approach extracts more information. When he releases his code I'll have to see how I can combine the two different approaches.

Regards, Jörg

from gcviewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.