krotscheck_vaca | Zara: Sure? Ping me tomorrow afternoon (your time) and I'll see what I can suggest. | 00:05 |
---|---|---|
*** jtomasek has joined #storyboard | 06:20 | |
-openstackstatus- NOTICE: Gerrit is going to be restarted due to bad performance | 07:15 | |
*** faybrocklebank has quit IRC | 07:37 | |
*** faybrocklebank has joined #storyboard | 07:38 | |
*** mrmartin has joined #storyboard | 07:45 | |
*** SotK has quit IRC | 10:01 | |
*** SotK has joined #storyboard | 10:03 | |
*** openstackgerrit has quit IRC | 10:48 | |
*** openstackgerrit has joined #storyboard | 10:48 | |
*** krotscheck_vaca is now known as krotscheck | 11:13 | |
*** jtomasek_ has joined #storyboard | 11:36 | |
*** jtomasek_ has quit IRC | 11:50 | |
Zara | afternoon, storyboard! | 12:07 |
krotscheck | ohai! | 12:16 |
Zara | hi! :D | 12:16 |
Zara | I was ill this morning | 12:16 |
Zara | but I am now around! | 12:20 |
openstackgerrit | Zara proposed openstack-infra/storyboard-webclient: Remove redundant 'code' https://review.openstack.org/301086 | 12:30 |
Zara | krotscheck: 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 |
Zara | so 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 |
krotscheck | Gotcha | 12:47 |
krotscheck | Tee hee | 12:47 |
krotscheck | I find it ironic that this failed linting. | 12:48 |
Zara | :D | 12:48 |
krotscheck | NPM timeout, rechecking ; | 12:48 |
Zara | yeah | 12:49 |
Zara | aw, 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 | |
krotscheck | WHile 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 |
krotscheck | That was my original thought, but the sane-cache-header parts never materialized. | 12:51 |
krotscheck | The 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 |
krotscheck | Mind 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 |
krotscheck | Aaaanyway, lemme go look at the code | 12:53 |
krotscheck | Zara: 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 | |
Zara | ah, 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 |
Zara | https://github.com/openstack-infra/storyboard-webclient/blob/master/src/app/services/resource/subscription_list.js | 13:02 |
Zara | (I'm also refreshing my memory on it now...) | 13:02 |
Zara | so 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 |
Zara | It'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 |
krotscheck | Hrm. I don't see an invocation of subsList | 13:11 |
Zara | https://github.com/openstack-infra/storyboard-webclient/blob/master/src/app/projects/controller/project_list_controller.js , for example | 13:15 |
Zara | I 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 b3rnard0 | 14:04 | |
krotscheck | Zara: 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 |
krotscheck | It seems like you're loading it in two places though- once in the controller, and once in the directive. | 14:14 |
Zara | I can believe that :D | 14:15 |
Zara | let's see... | 14:16 |
krotscheck | Zara: If you really want to be efficient about subscription loading, a better approach would be to modify the service itself. | 14:20 |
krotscheck | Keep 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 | |
krotscheck | Here- 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 |
krotscheck | https://github.com/krotscheck/cv/blob/master/src%2Fjs%2Fapp%2Fservice%2Fevent.js | 14:22 |
*** mrmartin has quit IRC | 14:24 | |
krotscheck | It 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 #storyboard | 14:25 | |
Zara | I'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 |
Zara | I should probably learn what the $q service actually does, it's still just 'promises stuff' in my head | 14: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 |
krotscheck | Zara: I think a left hemisphere wrote that. | 14:55 |
Zara | :) | 14:56 |
*** mrmartin has quit IRC | 15:01 | |
*** mrmartin has joined #storyboard | 15:03 | |
*** mrmartin has quit IRC | 15:04 | |
Zara | this is tangential, but I'm wondering why that code replaces the dates, if it's just getting the events? | 15:07 |
krotscheck | Dates? | 15:14 |
krotscheck | Oh. | 15:15 |
krotscheck | It's casting an ISO date string into a Date() instance. | 15:15 |
krotscheck | Convenience sugar. | 15:15 |
Zara | ohh, right | 15:15 |
Zara | I thought it was changing the actual dates, but I hadn't looked beyond that file to check... | 15:16 |
krotscheck | If you're curious to see it in action, the whole thing is published here krotscheck.github.io/cv/ | 15:17 |
* Zara hires krotscheck | 15: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 | :-P | 15:34 |
*** b3rnard0 is now known as b3rnard0_away | 16:55 | |
* Zara vanished to sort out austin flights | 17:06 | |
Zara | hm, s.o.o is taking a long time to load from here | 17:09 |
Zara | I'm not sure if it's my connection or if something's up | 17:09 |
* Zara sees task notes for https://storyboard.openstack.org/#!/story/2000521 and giggles | 17:10 | |
pedroalvarez | it goes fine from here | 17:10 |
Zara | I found the stories list and the boards & worklists page were slow | 17:11 |
Zara | but now they seem okay again :/ | 17:12 |
* Zara goes back to looking at the angularjs example, several hours later... | 17:14 | |
Zara | confused 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 #storyboard | 17:26 | |
krotscheck | Zara: That's an inline conditional. | 17:37 |
*** b3rnard0_away is now known as b3rnard0 | 17:39 | |
Zara | ah, I read it as 'if a > b, return -1, else return 1', but I couldn't remember the name for it to chechk | 17:40 |
*** mrmartin has quit IRC | 17:58 | |
Zara | how is it already 7pm | 17:58 |
Zara | I'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 |
Zara | night, all | 18:32 |
*** mrmartin has joined #storyboard | 19:25 | |
*** mrmartin has quit IRC | 20:10 |
Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!