me0wster / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

Possibility to specify max history time (or files size limit) in the same way that storage-directory #234

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Our servers melody files gets over 3gb after 2 months usage, I'm just wondering 
if there is a way to limit that - dumping old history ...

Original issue reported on code.google.com by nlesc...@gmail.com on 6 Jul 2012 at 10:13

GoogleCodeExporter commented 9 years ago
3gb of files for monitoring data seems a bit too much.

I suggest to use JavaMelody 1.37 or later, because of that line in the release 
notes of 1.37:
"added: Reduce the possibility of storage overload by deleting automatically 
the obsolete RRD files (which were not updated for the last 3 months), and 
which were for requests which do not exist anymore (revision 2750 and r2753). 
Note: the size of existing RRD files is fixed for ever and old .ser.gz files 
are already automatically deleted after a year."
https://code.google.com/p/javamelody/wiki/ReleaseNotes

And I suggest to check in the statistics of requests in your reports, if you 
have many http or sql requests which are the same, except some dynamic values 
of parameters (click the header to sort the column by request name). If yes, it 
would be better to aggregate these same http or sql requests by ignoring 
dynamic values of parameters.
To do this aggregation of requests, you can use the "http-transform-pattern" or 
"sql-transform-pattern" parameters. See the user guide:
https://code.google.com/p/javamelody/wiki/UserGuide#6._Optional_parameters

For example, you can use the "http-transform-pattern" parameter with a regular 
expression such as "\d+" to remove numbers, such as an identifier, in the http 
requests.
Or you can use the "sql-transform-pattern" parameter with a regular expression 
such as "\'.+\'" to remove values between quotes in the sql requests.

Original comment by evernat@free.fr on 6 Jul 2012 at 12:43

GoogleCodeExporter commented 9 years ago
Thanks a lot for this thourough answer !!

I guess that solves my problem then :)

Original comment by nlesc...@gmail.com on 9 Jul 2012 at 9:56

GoogleCodeExporter commented 9 years ago
Hi,

I have added the sql-transform-pattern and set it to

(values \(.+\))|(VALUES \(.+\))|((\d|_)*)

I now have weird character appearing in my logs for sql requests:

$s$e$l$e$c$t$ $e$t$a$b$l$i$s$s$e$m$$.$p$k$$i$d$ $a$s$ $p$k$$,$
$e$t$a$b$l$i$s$s$e$m$$.$c$r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ql8592e2f9ef0d88e65b4c365bc6ecc8dd20ae5fa8>

I want to replace
- values (...)
- VALUES (...)
- and anything like 1_50_ because of hibernate weird aliases naming

with an empty string.

My regex is correct I think.

Is there anything I missed ?

Thanks a lot,

Nic

Original comment by nlesc...@gmail.com on 9 Jul 2012 at 12:37

GoogleCodeExporter commented 9 years ago
Yes, I also think that hibernate alias naming is weird. And why don't they use 
a simple naming for the simple cases?

But the last part, and in particular the "_", seems to be the cause of your 
problem with the regexp. Note that "$" is the replacement for the aggregated 
parts like "values (...)".
If you remove "((\d|_)*)" and use "(values \(.+\))|(VALUES \(.+\))", then I 
think it will be ok.

Original comment by evernat@free.fr on 9 Jul 2012 at 2:17

GoogleCodeExporter commented 9 years ago
Thanks !!

I managed to work it out playing with the regex :)

Original comment by nlesc...@gmail.com on 9 Jul 2012 at 6:58

GoogleCodeExporter commented 9 years ago
ok, bye

Original comment by evernat@free.fr on 9 Jul 2012 at 9:23

GoogleCodeExporter commented 9 years ago

Original comment by evernat@free.fr on 9 Jul 2012 at 9:23