Monday, 2016-04-04

krotscheck_vacaZara: Sure? Ping me tomorrow afternoon (your time) and I'll see what I can suggest.00:05
*** jtomasek has joined #storyboard06:20
-openstackstatus- NOTICE: Gerrit is going to be restarted due to bad performance07:15
*** faybrocklebank has quit IRC07:37
*** faybrocklebank has joined #storyboard07:38
*** mrmartin has joined #storyboard07:45
*** SotK has quit IRC10:01
*** SotK has joined #storyboard10:03
*** openstackgerrit has quit IRC10:48
*** openstackgerrit has joined #storyboard10:48
*** krotscheck_vaca is now known as krotscheck11:13
*** jtomasek_ has joined #storyboard11:36
*** jtomasek_ has quit IRC11:50
Zaraafternoon, storyboard!12:07
krotscheckohai!12:16
Zarahi! :D12:16
ZaraI was ill this morning12:16
Zarabut I am now around!12:20
openstackgerritZara proposed openstack-infra/storyboard-webclient: Remove redundant 'code'  https://review.openstack.org/30108612:30
Zarakrotscheck: okay, so a while ago I changed the subscriptions code, so that sb would only do one GET to fetch the whole list, instead of one GET per subscription on a page. ^ is the absolute worst bit, but there are probably a lot of more subtle 'what is that?!' things in there.12:32
Zaraso I can't promise to remember everything but I figure some general 'this is bad and this is why and here's how it should be done' would be helpful to me, for the future.12:41
krotscheckGotcha12:47
krotscheckTee hee12:47
krotscheckI find it ironic that this failed linting.12:48
Zara:D12:48
krotscheckNPM timeout, rechecking ;12:48
Zarayeah12:49
Zaraaw, for a second I was hoping the linting was weird and complained if I didn't do it, and that's why I'd done it.12:49
* krotscheck takes a moment to go off on a tangent.12:50
krotscheckWHile a get request per resource is technically a bad thing, it's also not actually that bad if the API provides sane caching headers.12:50
krotscheckThat was my original thought, but the sane-cache-header parts never materialized.12:51
krotscheckThe idea was: A list is far more likely to change frequently. An individual record not so much. So if I make a GET request every time, but the API says: Hey browser, don't bother refreshing the cache until XXXX seconds from now... then it could be that the individual requests have less network overhead.12:52
krotscheckMind you, if subscriptions is a more-or-less static resource and will never change, then loading it and holding it in memory will always be more efficient.12:53
krotscheckAaaanyway, lemme go look at the code12:53
krotscheckZara: Where's the code bit that loads the GET for the whole list?12:56
* krotscheck only sees per-directive Subscription.browse() requests.12:56
Zaraah, yeah, it's not the entire list, I think, it's the whole list for that type of thing? (so all project subscriptions, or all story subscriptions)13:02
Zarahttps://github.com/openstack-infra/storyboard-webclient/blob/master/src/app/services/resource/subscription_list.js13:02
Zara(I'm also refreshing my memory on it now...)13:02
Zaraso this is me trying to remember code I got working half a year ago that I only half-understood in the first place.13:03
Zara\o/13:03
ZaraIt's good to have the context on it. I didn't know there was a plan to improve caching headers (or that they were a thing) at the time.13:05
krotscheckHrm. I don't see an invocation of subsList13:11
Zarahttps://github.com/openstack-infra/storyboard-webclient/blob/master/src/app/projects/controller/project_list_controller.js , for example13:15
ZaraI think the fact that it's in like every controller is probably one of many issues with it.13:15
*** b3rnard0_away is now known as b3rnard014:04
krotscheckZara: yeah, that could be an issue. Hard problem- making sure that list is up-to-date and making sure that the API doesn't get hammered.14:14
krotscheckIt seems like you're loading it in two places though- once in the controller, and once in the directive.14:14
ZaraI can believe that :D14:15
Zaralet's see...14:16
krotscheckZara: If you really want to be efficient about subscription loading, a better approach would be to modify the service itself.14:20
krotscheckKeep the in-application API the same (read(), create(),etc), but change the underlying implementation to be far more efficient about when it loads data.14:21
* krotscheck is lookig for an example....14:21
krotscheckHere- this one only loads a JSON file, but things like filtering and item selection are handled in browser memory rather than with an API call.14:22
krotscheckhttps://github.com/krotscheck/cv/blob/master/src%2Fjs%2Fapp%2Fservice%2Fevent.js14:22
*** mrmartin has quit IRC14:24
krotscheckIt all hinges on the fact that getEvents() only ever returns a promise, which is only refreshed if the high-level deferred variable is not yet set. This can be helpful for your own Create/Delete methods, because once you make a successful call to storyboard, you can unset that variable and have it all refresh all hunky dory.14:24
*** mrmartin has joined #storyboard14:25
ZaraI'm looking at it now, from the start to the end, and trying to follow what's going on. can already tell I understand a lot more of the syntax these days.14:27
ZaraI should probably learn what the $q service actually does, it's still just 'promises stuff' in my head14:28
Zara"The purpose of the deferred object is to expose the associated Promise instance as well as APIs that can be used for signaling the successful or unsuccessful completion, as well as the status of the task." did a philosopher write this.14:32
krotscheckZara: I think a left hemisphere wrote that.14:55
Zara:)14:56
*** mrmartin has quit IRC15:01
*** mrmartin has joined #storyboard15:03
*** mrmartin has quit IRC15:04
Zarathis is tangential, but I'm wondering why that code replaces the dates, if it's just getting the events?15:07
krotscheckDates?15:14
krotscheckOh.15:15
krotscheckIt's casting an ISO date string into a Date() instance.15:15
krotscheckConvenience sugar.15:15
Zaraohh, right15:15
ZaraI thought it was changing the actual dates, but I hadn't looked beyond that file to check...15:16
krotscheckIf you're curious to see it in action, the whole thing is published here krotscheck.github.io/cv/15:17
* Zara hires krotscheck15:22
Zara(I do want to change the timeline events in sb so that they only display comments by default, with a 'show me everything' button for all the other stuff... but I can't pay anyone to work on it, so looks like that's on my todo list)15:26
krotscheck:-P15:34
*** b3rnard0 is now known as b3rnard0_away16:55
* Zara vanished to sort out austin flights17:06
Zarahm, s.o.o is taking a long time to load from here17:09
ZaraI'm not sure if it's my connection or if something's up17:09
* Zara sees task notes for https://storyboard.openstack.org/#!/story/2000521 and giggles17:10
pedroalvarezit goes fine from here17:10
ZaraI found the stories list and the boards & worklists page were slow17:11
Zarabut now they seem okay again :/17:12
* Zara goes back to looking at the angularjs example, several hours later...17:14
Zaraconfused by syntax at line 63, probably just not familiar enough with the syntax ( https://github.com/krotscheck/cv/blob/master/src/js/app/service/event.js#L63 )17:15
*** mrmartin has joined #storyboard17:26
krotscheckZara: That's an inline conditional.17:37
*** b3rnard0_away is now known as b3rnard017:39
Zaraah, I read it as 'if a > b, return -1, else return 1', but I couldn't remember the name for it to chechk17:40
*** mrmartin has quit IRC17:58
Zarahow is it already 7pm17:58
ZaraI've been far too distracted today, sorry. I'm hoping to look back at all this tomorrow. also need to get gerrit set up to send things to the python client, so also need to look over friday's logs... anyway, I'm going to make myself ill if I keep trying to work while I can't concentrate, so I'm leaving it for tomorrow.18:32
Zaranight, all18:32
*** mrmartin has joined #storyboard19:25
*** mrmartin has quit IRC20:10

Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!