anjana-ackroyd / javamelody

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

Preventing adicional dialog boxes when clearing stats doesn't work #469

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.Clear stats from the "all" period

2.Accept both dialog boxes popping up and select "prevent this page from 
showing new dialog boxes"

3.Next time you want to clear stats, the link won't work, only when clearing 
cache the link works again, but dialog boxes keep showing.

This is particularly painful to me, because i'm trying to get new data each 5 
min, and the only way i could achieve that would be by clearing data each time 
i look for it and the dialog boxes keep my curl command from resetting the 
data. 

I'm using JavaMelody to monitor an Alfresco, I get data from different sources 
and then merge them into Cacti.

Maybe someone knows about another way of resetting through commands remotely, 
that would be of use too.

Thanks.

Original issue reported on code.google.com by ab.light...@gmail.com on 24 Mar 2015 at 11:20

GoogleCodeExporter commented 9 years ago
First, note that the "prevent this page from showing new dialog boxes" is a 
browser specific feature (of google chrome), so javamelody does not have much 
to do with that browser feature if it does not work as you want.

But, fortunately if you want to clear all stats from a browser or from a script 
with wget or curl, you just have to call the following URL (host and context 
depends on your server):
http://host/context/monitoring?action=clear_counter&counter=all
And ignore the "OK" dialog box in the result.

By the way, if you want to get data as JSON or as XML from a script, you can 
read about JSON and XML at
https://code.google.com/p/javamelody/wiki/ExternalAPI

Original comment by evernat@free.fr on 29 Mar 2015 at 10:28

GoogleCodeExporter commented 9 years ago
I'm aware of that URL to call using cURL, but when i try it the process will 
not end, and the stats are not cleared. I guessed it was because it kept 
waiting for the confirmation of the dialog box, could it be? I'll attach the 
output of the cURL command you told me, maybe it'll help and you can see 
something i didn't.
Thanks a lot!

Original comment by ab.light...@gmail.com on 30 Mar 2015 at 2:55

Attachments:

GoogleCodeExporter commented 9 years ago
In the debugging logs at the end of page, it is written:
Mon Mar 30 16:25:35 CEST 2015   DEBUG   Action 'CLEAR_COUNTER' executed. Result: 
Statistics null cleared.
Mon Mar 30 16:30:38 CEST 2015   DEBUG   Action 'CLEAR_COUNTER' executed. Result: 
Statistics null cleared.
Mon Mar 30 16:33:05 CEST 2015   DEBUG   Action 'CLEAR_COUNTER' executed. Result: 
Statistics null cleared.
Mon Mar 30 16:39:21 CEST 2015   DEBUG   Action 'CLEAR_COUNTER' executed. Result: 
Statistics null cleared.
Mon Mar 30 16:41:17 CEST 2015   DEBUG   Action 'CLEAR_COUNTER' executed. Result: 
Statistics null cleared.
Mon Mar 30 16:42:57 CEST 2015   DEBUG   Action 'CLEAR_COUNTER' executed. Result: 
Statistics null cleared.
Mon Mar 30 16:45:12 CEST 2015   DEBUG   Action 'CLEAR_COUNTER' executed. Result: 
Statistics null cleared.
Mon Mar 30 16:45:46 CEST 2015   DEBUG   Action 'CLEAR_COUNTER' executed. Result: 
Statistics null cleared.
Mon Mar 30 16:47:09 CEST 2015   DEBUG   Action 'CLEAR_COUNTER' executed. Result: 
Statistics null cleared.

In these messages, "null" is not good.
And it seems that when you call the URL with curl, the "&counter=all" is 
missing.
You should call http://host/context/monitoring?action=clear_counter&counter=all
and not http://host/context/monitoring?action=clear_counter

Maybe you need to write the URL between double-quotes?

Original comment by evernat@free.fr on 1 Apr 2015 at 10:52