| 39 | | Once the graphviz plugin has been installed either via source or via a |
|---|
| 40 | | python egg, some configuration is needed before it can be used. |
|---|
| 41 | | |
|---|
| 42 | | A new section called graphviz should be added to the conf/trac.ini |
|---|
| 43 | | file with these fields: |
|---|
| 44 | | |
|---|
| 45 | | cache_dir - The directory that will be used to cache the |
|---|
| 46 | | generated images. |
|---|
| 47 | | |
|---|
| 48 | | prefix_url - The url to be used to find the cached images. This |
|---|
| 49 | | must point to the trac server's view of the |
|---|
| 50 | | cache_dir location. |
|---|
| 51 | | |
|---|
| 52 | | cmd_path - Full path to the directory where the graphviz |
|---|
| 53 | | programs are located. |
|---|
| 54 | | |
|---|
| 55 | | out_format - Graph output format. Valid formats are: png, jpg, |
|---|
| 56 | | svg, svgz, gif. If not specified, the default is |
|---|
| 57 | | png. This setting can be overrided on a per-graph |
|---|
| 58 | | basis. |
|---|
| 59 | | |
|---|
| 60 | | processor - Graphviz default processor. Valid processors are: |
|---|
| 61 | | dot, neato, twopi, fdp, circo. If not specified, |
|---|
| 62 | | the default is dot. This setting can be overrided |
|---|
| 63 | | on a per-graph basis. |
|---|
| 64 | | |
|---|
| 65 | | png_antialias - If this entry exists in the configuration file, |
|---|
| 66 | | then PNG outputs will be antialiased and the |
|---|
| 67 | | rsvg_path must be defined. |
|---|
| 68 | | |
|---|
| 69 | | rsvg_path - Full path to where the rsvg binary can be found. |
|---|
| 70 | | |
|---|
| 71 | | default_* - These settings define the default graph, node and |
|---|
| 72 | | edge attributes. They must be written as : |
|---|
| 73 | | default_TYPE_ATTRIBUTE = VALUE |
|---|
| 74 | | where TYPE is one of graph, node, edge |
|---|
| 75 | | ATTRIBUTE is a valid graphviz attribute |
|---|
| 76 | | VALUE is the attribute value. |
|---|
| 77 | | eg: default_edge_fontname = "Andale Mono" |
|---|
| 78 | | default_graph_fontsize = 10 |
|---|
| 79 | | |
|---|
| 80 | | cache_manager - If this entry exists in the configuration file, |
|---|
| 81 | | then the cache management logic will be invoked |
|---|
| 82 | | and the cache_max_size, cache_min_size, |
|---|
| 83 | | cache_max_count and cache_min_count must be |
|---|
| 84 | | defined. |
|---|
| 85 | | |
|---|
| 86 | | cache_max_size - The maximum size in bytes that the cache should |
|---|
| 87 | | consume. This is the high watermark for disk space |
|---|
| 88 | | used. |
|---|
| 89 | | |
|---|
| 90 | | cache_min_size - When cleaning out the cache, remove files until |
|---|
| 91 | | this size in bytes is used by the cache. This is |
|---|
| 92 | | the low watermark for disk space used. |
|---|
| 93 | | |
|---|
| 94 | | cache_max_count - The maximum number of files that the cache should |
|---|
| 95 | | contain. This is the high watermark for the |
|---|
| 96 | | directory entry count. |
|---|
| 97 | | |
|---|
| 98 | | The cache_dir and prefix_url entries are related to each other. The |
|---|
| 99 | | cache_dir entry points to a location on the file system and the |
|---|
| 100 | | prefix_url points to the same location but from the trac server's |
|---|
| 101 | | point of view. This allows the graphviz programs to generate the |
|---|
| 102 | | images and the user's web browser to view them. |
|---|
| 103 | | |
|---|
| 104 | | The cache_dir directory must exist and the trac server must have read |
|---|
| 105 | | and write access. |
|---|
| 106 | | |
|---|
| 107 | | The cache manager is an attempt at keeping the cache directory under |
|---|
| 108 | | control. This is experimental code that may cause more problems than |
|---|
| 109 | | it fixes. The cache manager will be invoked only if a new graphviz |
|---|
| 110 | | image is to be produced. If the image can be loaded from the cache, |
|---|
| 111 | | then the cache manager shouldn't need to run. This should minimize the |
|---|
| 112 | | I/O performance impact on the trac server. When the cache manager |
|---|
| 113 | | determines that it should clean up the cache, it will delete files |
|---|
| 114 | | based on the file access time. The files that were least accessed will |
|---|
| 115 | | be deleted first. |
|---|
| 116 | | |
|---|
| 117 | | |
|---|
| 118 | | Configuration Example |
|---|
| 119 | | +++++++++++++++++++++ |
|---|
| 120 | | |
|---|
| 121 | | Here is a sample graphviz section: |
|---|
| 122 | | |
|---|
| 123 | | [graphviz] |
|---|
| 124 | | cache_dir = /tmp/trac/htdocs/graphviz |
|---|
| 125 | | prefix_url = http://localhost:8000/trac/chrome/site/graphviz |
|---|
| 126 | | cmd_path = /usr/bin |
|---|
| 127 | | out_format = png |
|---|
| 128 | | png_antialias = true |
|---|
| 129 | | rsvg_path = /usr/bin/rsvg |
|---|
| 130 | | default_graph_fontname = "Andale Mono" |
|---|
| 131 | | default_graph_fontsize = 10 |
|---|
| 132 | | |
|---|
| 133 | | |
|---|
| 134 | | Here is a sample graphviz section that activates the cache manager: |
|---|
| 135 | | |
|---|
| 136 | | [graphviz] |
|---|
| 137 | | cache_dir = /tmp/trac/htdocs/graphviz |
|---|
| 138 | | prefix_url = http://localhost:8000/trac/chrome/site/graphviz |
|---|
| 139 | | cmd_path = /usr/bin |
|---|
| 140 | | out_format = png |
|---|
| 141 | | png_antialias = true |
|---|
| 142 | | rsvg_path = /usr/bin/rsvg |
|---|
| 143 | | default_graph_fontname = "Andale Mono" |
|---|
| 144 | | default_graph_fontsize = 10 |
|---|
| 145 | | cache_manager = yes |
|---|
| 146 | | cache_max_size = 10000000 |
|---|
| 147 | | cache_min_size = 5000000 |
|---|
| 148 | | cache_max_count = 2000 |
|---|
| 149 | | cache_min_count = 1500 |
|---|
| 150 | | |
|---|
| 151 | | The cache manager is turned on since there is an entry in the graphviz |
|---|
| 152 | | section called cache_manager. The value doesn't matter. To turn off |
|---|
| 153 | | the cache manager, simply comment out the cache_manager entry. |
|---|
| 154 | | |
|---|
| 155 | | When the size of all the files in the cache directory exceeds |
|---|
| 156 | | 10,000,000 bytes or the number of files in the cache directory exceeds |
|---|
| 157 | | 2,000, then files are deleted until the size is less than 5,000,000 |
|---|
| 158 | | bytes and the number of files is less than 1,500. |
|---|
| | 39 | TODO |
|---|