Giter Site home page Giter Site logo

jcoz's Introduction

Join the chat at https://gitter.im/JCoz-profiler/community

Overview

JCoz is the world's first causal profiler for Java (and eventually all JVM) programs. It was inspired by coz, the original causal profiler.

For documentation, including installing, building, and using JCoz, please see our Wiki page page.

Dependencies

  • spdlog (0.11.0 or higher)
    • apt-get install libspdlog-dev for debian/ubuntu
    • yum install spdlog-devel for fedora/rhel/centos
  • make
  • jdk, of course

Getting Started Tutorial

Build and shakeout

You can drive a basic test use case through the Makefile.

Start by building everything from scratch:

$ make clean
$ make all

Now, to get started, open three terminal windows:

(1) $ make run-rmi-host
(2) $ make run-workload
(3) $ make run-profiler

From the third (profiler) window, after a few moments you will see some output appear:

(3)
experiment	selected=test.TestThreadSerial:67	speedup=0.0	duration=20003047916
progress-point	name=end-to-end	type=source	delta=0

This is the coz flat file format. Leave the application to run for a period of time, and you will see more profiling samples collected.

If you've made it this far, congrats, you can proceed to running the CLI for a proper profiling run! The 'run-profiler' process should terminate after about 30 seconds.

Unfortunately we do not have enough datapoints from a 30 second run to get sufficient confidence for coz to recommend the lines of code to improve.

Running the CLI

Using the CLI, we can collect as many datapoints as we like. Keeping the RMI host and workload running, start the CLI. Check the PID of the monitored host with ps.

(3)
$ CLIENT_JAR=./src/java/target/client-0.0.1-jar-with-dependencies.jar
$ TOOLS_JAR=/usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jar
$ java -cp ${CLIENT_JAR}:${TOOLS_JAR} \
    jcoz.client.cli.JCozCLI \
    -c test.TestThreadSerial \
    -l 57 \
    -s test \
    -p $PID_OF_WORKLOAD
...
experiment	selected=test.TestThreadSerial:62	speedup=0.6	duration=4747080912
progress-point	name=end-to-end	type=source	delta=98
experiment	selected=test.TestThreadSerial:73	speedup=0.45	duration=4647873501
progress-point	name=end-to-end	type=source	delta=96
experiment	selected=test.TestThreadSerial:73	speedup=0.0	duration=5002572016
progress-point	name=end-to-end	type=source	delta=100
experiment	selected=test.TestThreadSerial:62	speedup=0.35	duration=4858058541
progress-point	name=end-to-end	type=source	delta=99
...

Results will start appearing in the profile output.

Getting a profiling visualisation

Save the results you previously captured to a file foo.coz.

Open the coz UI here, and upload the file and review the output.

Profiling a real application

You should now be in a position to profile a real application. Use the JCozCLI and capture some samples!

Be aware for that a real sized application there will be lots of code and lots of experiments that JCoz needs to run. You should plan to keep JCoz running for some hours to be confident in the results.

jcoz's People

Contributors

byte-lab avatar mkst avatar mattperron avatar streetster avatar jasonk000 avatar octogonapus avatar decave avatar skjolber avatar

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.