Git Product home page Git Product logo

callgrind-to-plantuml-sequence-diagram's Introduction

Callgrind to PlantUML

Generate PlantUML sequence diagrams for PHP using XDebug callgrind files

Requirements

To setup and run the application you will need:

  • PHP ^7.0
  • Composer

Rendering requirements

If you want to use the "image" export option, you will additionally need:

Setup

  1. checkout this repository
  2. run composer install

Usage

By default, running the command will take the entire input of the given callgrind file, and use it to produce a PlantUML format sequence diagram. Keep in mind that these will be very large for most applications. To limit the size of the diagram, see the filters section. Rendering large diagrams will require a lot of RAM and may require tweaking the memory settings for the JVM.

Running the command

php application.php generate <callgrind-file>

Export format

On runtime, the user can choose between the following export formats:

  1. Screen
  2. File
  3. Image

1. Screen

When using this option, the PlantUML sequence diagram will be outputted to StdOUT in text representation. No further configuration is needed for this option.

2. File

When using this option, the PlantUML sequence diagram will be saved to the specified file location, and will contain the sequence diagram in text representation. After choosing this option you will be prompted with:

  • Output file name
  • Output file location

3. Image

When using the image option, the application will use the PlantUML and Graphiz DOT application to produce a PNG image containing the sequence diagram. After choosing this option you will be prompted with:

  • DOT file location
  • JAR file location
  • Max memory (for JRE)
  • Max diagram size (for PlantUML)
  • Output file name
  • Output file location

Filters

To be able to control the size of you diagram (and focus on a specific part) you can apply filters.

Not deeper than

This filter will recursively filter out calls that happen inside the given method call. The call itself will still be shown in the sequence diagram. Multiple not-deeper-than filters can be applied!

Example 1: usage without wildcard

php application.php generate <callgrind-file> --not-deeper-than MyClass::someMethod

In this example, any calls happening within someMethod() in class MyClass will not be shown in the sequence diagram.

Example 2: usage with a wildcard

php application.php generate <callgrind-file> --not-deeper-than Some\NameSpace% 

In this example, any calls happening within classes in the namespace Some\Namespace will not be shown in the sequence diagram.

Example 3: using multiple not-deeper-than filters

php application.php generate <callgrind-file> --not-deeper-than MyClass::someMethod --not-deeper-than AnotherClass::anotherMethod

In this example, any calls happening within someMethod() in class MyClass, or within anotherMethod() in AnotherClass will not be shown in the sequence diagram.

Start from

When using this filter, only the given call and any calls happening inside of it will be shown in the sequence diagram.

Example:

php application.php generate <callgrind-file> --start-from MyApp\HomeController::homePageAction

Exclude native function calls (enabled by default)

This filter will filter out any calls to the PHP API that do not perform any deeper calls.

Example: turning off the native function call filter

php application.php generate <callgrind-file> --exclude-native-function-calls 0

Maintainers:

papapezs desjob

callgrind-to-plantuml-sequence-diagram's People

Contributors

desjob avatar papapezs avatar sebastianbergmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

lausen marcelomx

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.