Charts are not updated even when rrd data changes

Bug #804544 reported by Richard Wall
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Jarmon
Status tracked in Trunk
Trunk
Fix Released
Medium
Richard Wall

Bug Description

Hi there,

Jarmon is really nice, and the example interface very nearly does everything I need.

However, I noticed that it reads RRD files on startup, and then doesn't read them again, even if you reload the page. Is there a way for it to re-read the files without having to stop the daemon and restart it?

Also, reloading the page resets which tab it's on -- is there a way to have it keep the same tab when you do a reload?

Thanks!

Related branches

Revision history for this message
Richard Wall (richardw) wrote :

Thanks Jeff,

I converted your question to a new bug.

I think the problem is likely to be that your web browser is caching the downloaded RRD files.

I used to use the "jquery.ajax.cache = false" setting in trunk - this caused jquery to append a random query string to each ajax request.
I recently removed that setting - it didn't seem to be necessary.

So can you send me the http headers (as reported by Firefox Firebug or Wireshark) of an initial RRD download and a subsequent download (after clicking "update" button)
Lets see how it compares to my headers from Firefox and Nginx.

{{{
GET /docs/examples/data/load/load.rrd HTTP/1.1

Host: localhost:8080

User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0

Accept: text/plain, */*; q=0.01

Accept-Language: en-gb,en;q=0.5

Accept-Encoding: gzip, deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Connection: keep-alive

X-Requested-With: XMLHttpRequest

Referer: http://localhost:8080/docs/examples/

If-Modified-Since: Fri, 01 Jul 2011 21:45:17 GMT

HTTP/1.1 304 Not Modified

Server: nginx/0.8.54

Date: Fri, 01 Jul 2011 21:45:21 GMT

Last-Modified: Fri, 01 Jul 2011 21:45:17 GMT

Connection: keep-alive

...

GET /docs/examples/data/load/load.rrd HTTP/1.1

Host: localhost:8080

User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0

Accept: text/plain, */*; q=0.01

Accept-Language: en-gb,en;q=0.5

Accept-Encoding: gzip, deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Connection: keep-alive

X-Requested-With: XMLHttpRequest

Referer: http://localhost:8080/docs/examples/

If-Modified-Since: Fri, 01 Jul 2011 21:47:27 GMT

HTTP/1.1 200 OK

Server: nginx/0.8.54

Date: Fri, 01 Jul 2011 21:48:13 GMT

Content-Type: application/octet-stream

Last-Modified: Fri, 01 Jul 2011 21:48:07 GMT

Transfer-Encoding: chunked

Connection: keep-alive

Content-Encoding: gzip

}}}

You could also try using the following patch - which turns on the jquery anti-caching mechanism.

{{{
=== modified file 'jarmon/jarmon.js'
--- jarmon/jarmon.js 2011-06-26 22:03:58 +0000
+++ jarmon/jarmon.js 2011-07-01 21:18:12 +0000
@@ -241,6 +241,7 @@
     $.ajax({
         url: url,
         dataType: 'text',
+ cache: false,
         mimeType: 'text/plain; charset=x-user-defined',
         xhr: function() {
             // Save a reference to the native xhr object - we need it later

}}}

Ideally I don't want to use that technique. The correct solution probably involves some or all of the following:

 * Modify the Javascript to read the update interval from the initially downloaded RRD file and only re-request the file after that interval has passed.
 * Configure jquery / xhr to issue ajax requests with the if-modified-since and If-None-Match request headers
 * The web server should be configured to return etags and 304 not modified headers if the file has not changed.

I'll try and work on this in the next few days.

-RichardW

Revision history for this message
Jeff Mitchell (jefferai) wrote :

Hi there,

I won't be able to get you that information until Tuesday as it's at work. One thing that may be relevant is that I was using twistd to serve -- I plan on using nginx eventually but was using the given twistd command for a simple first-run test of Jarmon. It's possible that there's a difference there. Also, this was Firefox...something. I forget if it was 3.6.16 or 4.0(1) :-)

Thanks,
Jeff

Richard Wall (richardw)
Changed in jarmon:
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Richard Wall (richardw)
Richard Wall (richardw)
Changed in jarmon:
milestone: none → 11.08
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.