Skip to content

Basic usage

Evgeny Bovykin edited this page Apr 28, 2017 · 11 revisions

Generating graphs

To generate graphs, you will need to specify three main things

Files

To specify the files that graphs will be generated for, and that will be considered the "roots" of the graph, use --files parameter. All the root files will be marked red on the resulting graph.

Types of graphs

To actually generate a graph, you need to specify which graph you want. Also, you need to specify the yaml root, which is discussed below.

For include graph, use --include-graph

jabba --files maxscale_jobs/build.yaml --include-graph --yaml-root maxscale_jobs

Include graph For call graph, use --call-graph

jabba --files maxscale_jobs/build.yaml --call-graph --yaml-root maxscale_jobs

Call graph

Additional information on specific graphs, see include graph and call graph

What is yaml root?

You need to pass --yaml-root parameter, setting directory passed as yaml root. Yaml root is a directory that is considered a "secondary" root of a project. All jobs that are called by a name should be placed in this directory. For example, consider the following project structure

maxscale-jekins-jobs/
    maxscale_jobs/
        include/
        build.yaml
        cleanup.yaml

Yaml root should be set to maxscale_jobs, as this is the directory that contains all the job configs.

Export name

By default, generated graphs will be called {file_name}_include.svg for include graph, and {file_name}_call.svg for call graph, where {file_name} is a name of the first file passed to --files.

To set specific name for generated, use --name. Note that this will replace {file_name}, as _include or _call suffix will still be presented.

This will generate test_call.svg

jabba --files maxscale_jobs/build.yaml --call-graph --yaml-root maxscale_jobs --name test

Rank dir

Both call and include graphs can be generated in two ways - horizontal and vertical. The default is horizontal.

To change this behavior, use --rank-dir parameter. left-right will draw the graph horizontally, while up-down will draw the graph vertically.

Left right

jabba --files maxscale_jobs/build.yaml --call-graph --yaml-root maxscale_jobs --rank-dir left-right

Left right call graph

Up down

jabba --files maxscale_jobs/build.yaml --call-graph --yaml-root maxscale_jobs --rank-dir up-down

Up down call graph

Config

If you don't want to specify some common options like yaml root every time by hand, you can move them into config file. The default one is .jjv_config, which should be places in the root of the project.

Each option should be written in camel case. Note that setting parameters from cli will completely override the parameters in config.

For example, for setting yaml root and call parameters, use the following config

yaml_root: maxscale_jobs
call_parameters:
    - same-node
    - node-parameters

You can specify which config to use by using --config option

jabba --config cool_config.yaml

Note that you can use !include and !include-raw the same way you use it in you job configs.

Legend

For generating legend for your graphs, use --legend option

jabba --files maxscale_jobs/build.yaml --call-graph --yaml-root maxscale_jobs --legend

Call graph with legend