Shopify / dashing

The exceptionally handsome dashboard framework in Ruby and Coffeescript.
http://shopify.github.com/dashing/
MIT License
10.97k stars 1.18k forks source link

Widgets not being updated after a period of time #33

Open bashtoni opened 12 years ago

bashtoni commented 12 years ago

When a browser has the dashboard page open for some time, some widgets fail to update. Not all widgets fail to update at the same time, but the longer the browser session runs, seemingly the more widgets fail. Typically the first one will fail to update after only a few minutes.

Setting Dashing.debugMode = true I can see the data is making it as far as the browser, but the widgets fail to update. Hitting refresh in the browser causes the page to load with the correct values.

I'm running dashing from 'dashing start'. Most widgets have data inserted via a curl request, although one is using a job. The widget using the job does not appear to exhibit the issue, although this is a graph widget - all others are numbers.

Any suggestions on how I can debug this further?

boxiong commented 10 years ago

here is a potential fix

https://github.com/Shopify/dashing/pull/303

jloh commented 10 years ago

Can confirm I've got this issue as well, except I see it almost instantly with the Number widget.

Removing @accessor 'current', Dashing.AnimatedValue fixed the issue for me.

bogdanRada commented 10 years ago

for me it wasn't problem with the Widget itself, the problem was i was opening too many connections to a database and was timing out because of that. Fixing the connection problem solved it for me

lanox commented 9 years ago

I am having same issue with chrome where meter widget updates twice and stops. If i remove @accessor 'value', Dashing.AnimatedValue it works fine.

Is this been looked at all ?

MattRK commented 8 years ago

I'll add to the chorus and confirm that disabling the animation on the Number widget fixed the issue for us. (Running Midori on an raspberry pi)

bcole808 commented 8 years ago

For me, after loading a dashboard the number widgets would simply never update beyond the initial values. Removing @accessor 'value', Dashing.AnimatedValue got the numbers updating, but I was also able to leave the animation enabled and fix it by editing the job that updated values and making sure that each value was converted to an integer with .to_i and that seemed to fix my problem as well.

cptnslick commented 8 years ago

bcole808's suggestion is spot on. If you are passing true integer values the animated numbers work as they should.

For example: I'm using HTTParty's GET function to grab the values from a server:

response = HTTParty.get('URL')
temp = JSON.parse(response.body)[0]

send_event('temp', { value: temp.to_i })

The [0] piece is very important. It's tells the parse to pull the actual value out of the response instead of the response string ["70"]

JSON.parse(response.body)[0] ==> 70  (as a string, still need to convert to int)
JSON.parse(response.body) ==> ["70"]  (as a string with markup, can't convert to int)

I know that last part is off topic, but it took me a bit to figure out (ruby noob) and I wanted to share.