Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So it turns out that JavaMelody created unique RRD files for each URL and SQL request. Our REST service exposes hundreds of endpoints, and each of them can take thousands of values, like</p> <pre><code>http://server/get/entity/10 </code></pre> <p>where 10 can be any unique ID in the system. So we had as many RRD files as there were entities being queried.</p> <p>The documentation at <a href="https://github.com/javamelody/javamelody/wiki/UserGuide#6-optional-parameters" rel="nofollow">https://github.com/javamelody/javamelody/wiki/UserGuide#6-optional-parameters</a> hints at options called <code>http-transform-pattern</code> and <code>sql-transform-pattern</code>.</p> <blockquote> <p>The parameter http-transform-pattern is a regular expression to transform descriptions of http requests and to delete dynamic parts (identifiers of objects for example) in order to be able to aggregate on these requests </p> <p>Similarly, the parameter sql-transform-pattern is a regular expression to transform descriptions of sql requests (not binded identifiers for a "in" clause for example) in order to be able to aggregate on these requests.</p> </blockquote> <p>That is a very vague description of what these options do, and it is not immediately obvious how they help. But others that <a href="https://groups.google.com/forum/#!msg/javamelody/9bZYTH9cnoA/Bf8b-M1LkScJ" rel="nofollow">had the same problems</a> indicated that these settings fixed their issues, so I dug deeper.</p> <p>I suspect how these options work is by replacing any part of the URL that matches the regular expression with a "$". So setting <code>http-transform-pattern</code> to <code>\d+</code> means that the URLs <code>http://server/get/entity/10</code> and <code>http://server/get/entity/20</code> both have their digits matched by the regular expression, and are then aggregated into the URL <code>http://server/get/entity/$</code>. This in turn reduces the number of RRD files, as new ones are no longer created for every id.</p> <p>In our case we used lookbehinds to group URLs. So we set <code>http-transform-pattern</code> to something like <code>(?&amp;lt;=/server/get/fuzzballs).*|(?&amp;lt;=/server/get/foobars).*</code> to aggregate the URLs into the buckets <code>http://server/get/fuzzballs$</code> and <code>/server/get/foobars$</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload