hawtio / hawtio-kubernetes

hawtio plugin for working with kubernetes
Apache License 2.0
24 stars 14 forks source link

avoid flashing on some pages (pods with pod status and the Apps detail pages are the biggies) #12

Closed jstrachan closed 9 years ago

jstrachan commented 9 years ago

we need a more clever caching mechanism so that we only update the UI when things really change; right now we get lots of flashing....

davsclaus commented 9 years ago

Yes the apps page is really annoying

jstrachan commented 9 years ago

I've tried to fix it - at least we now generally rarely ever update the kube model now unless it really really does change significantly (and not just the resourceVersion changes). But still the flashing is still there...

davsclaus commented 9 years ago

The services and pods pages still blink

davsclaus commented 9 years ago

Wonder if they need same hack ?

gashcrumb commented 9 years ago

I spent awhile investigating it a few weeks back, and the only thing I could really spot is that when they flash off it's because the model doesn't have that value in it for that brief period of time. My guess is there's a $scope.$apply() at some point when the model is first set on the $scope, then a subsequent $scope.$apply after the model has been updated with these counts, as both calls to $apply() could cause the page to update. But I couldn't find that pattern in the code at the time, might take another stab now that James got me up and running against os1.fabric8.io :-)

davsclaus commented 9 years ago

That sounds like a very good description of what is the real problem.

I think hunting those Core.apply() events can be tricky to resolve.

gashcrumb commented 9 years ago

Yay, found it. The watch that hawtio-simple-table uses basically sees all the changes that are done on the model. Used an interim array to avoid the frequent page updates, seems to do the trick.

jstrachan commented 9 years ago

@gashcrumb who-hoo!!! well played!

davsclaus commented 9 years ago

Yat that makes video recoding nicer without those flashing ;)