Viewing posts by mhughes

Filtering lists in your angular dart templates.

Posted by: mhughes 1 week, 1 day ago

Last week I started a new project utilizing angular.dart, and it's been a great learning experience so far. Today, I wanted to try and figure out how to make an interface that looks something like this:

alt text

I have a single list of cards with a property on the card that determines which column it goes in.

I could have split up the list into 3 lists in my controller, but then I'd have to worry about keeping those column specific lists in sync with the master list. This is a multi-user realtime app, so that would have gotten troublesome quickly.

After a lot of wrangling, I figured out you can use the "filter" filter on a list to trim it down to the entries you care about. By using this three times, I was able to write a bit of template code to make it all work.

The filtering magic is in the "state in | filter:{column:'backlog'}" piece.

You can also see that I'm using ng-include for the body of the cards, so I don't have to repeat that for each column. And lastly, the behavior of the card itself is managed by a controller that binds to the kanban-cell attribute and is looking for a card-id attribute to tell it which card to display.

read more /

Quick update on uwsgi/nginx migration

Posted by: mhughes 1 month, 1 week ago

It's been 3 weeks since we switched from Apache/mod_wsgi to uwsgi/nginx and we have no regrets.

The trend of faster response times compared to the previous time frame has continued. And our mystery problem has completely gone away. Everything has been rock-solid.

read more /

A/B testing for performance

Posted by: mhughes 2 months ago

Lately, we've been having some growing pains with ScrumDo. Occasionally, our apache+mod_wsgi stack on our application servers would just get completely overwhelmed with an amount of traffic it should have been able to handle easily.

A couple days worth of debugging wasn't getting us closer to an answer, and we weren't giving our customers the experience they deserved. So we decided to give uwsgi+nginx a try instead of apache. After all, that's what pretty much every python shop will tell you to use these days anyways.

We wanted to make sure that we were actually doing better. We decided to put both apache and nginx/uwsgi application servers behind our load balancer at the same time and direct half our traffic to either.

Since we use New Relic to monitor our application, we could use it to perform this A/B test.

First, we created a brand new application in New Relic for the nginx/uwsgi install so we could keep our stats separate.

Then we picked out a few stats to track and added them to a custom dashboard. We went with Appdex (New Relic's overall metric of user satisfaction), request response times, and page load times. The results are below. While looking at them, keep an eye on the y-axis of the middle charts since left and right don't match.

dashboard results

As you can see, the right side (nginx+uwsgi) performed significantly better and should lead to much happier users.

Also remember, that we've been running Apache for years, and have tweaked the config numerous times to optimize it. This was our first stab at an nginx/uwsgi config, so there may be more performance we can squeeze out with a similar amount of tweaking, making it even better.

Also note, that during the 24 hour timeframe in those graphs, we did not experience that mysterious problem we were originally trying to fix. That's likely just chance since it didn't happen every day.

read more /

Debounce function for Dart

Posted by: mhughes 3 months, 2 weeks ago

I coudn't find an implementation of a debounce function for Dart (at least one that didn't assume a stream), so I wrote this one. Hope it helps someone else.

read more /

Serving angular.dart app files from an external CDN

Posted by: mhughes 3 months, 2 weeks ago

StackOverflow saved me a lot of hassle today, telling me how to serve the static files of an angular.dart application from a CDN who's URL might vary.

read more /