Why metrics? Since I joined 7digital I've seen the API grow from a brand new feature side by side with the (then abundant) websites to be the main focus of the company. The traffic grew and grew and keeps on growing in an accelerated pace and that brings us new challenges. We've brought the agile perspective into play which has made us adapt faster and make fewer errors but:

  • We can do unit tests but they don't bring out the behaviour.
  • We can do integration tests but they won't show the whole flow.
  • We can do smoke tests but they won't show us realistic usage.
  • We can do load test but they won't have realistic weighting.

Even when we do acceptance criteria we are actually being driven by assumptions, even with an experienced developer he is really just sampling all his previous work and as we move to a larger number of servers and applications it's not humanly possible to take all variables into consideration. It is common to hear statements like 'keep an eye on the error log/server log/payments log when releasing this new feature' but when something breaks it's all about 'what was released/when was it released/is it a specific server?'. As the data grows it becomes harder to sample and deduce from it quickly enough to feedback without causing issues, especially when agile tends to implement intermediary solutions which might have different behaviours from the final solution that have not been studied. The truth is that nothing replaces real life data and statistics – including developers opinions – if it the issue is a black swan then we need to churn out usable information fast!



Taken from @gregyoung This has been seen before by other companies; for example, Flickr on their Counting and Timing blog post. See also Building Scalable Websites by Flickr's Cal Henderson. This advice has been followed by other companies like Etsy on their Measure Anything Measure Everything blog post or Shopify on their StatsD blog post. How to do it? Decided to start with a winning horse I picked up the tools used by these companies: StatsD is described as “a network daemon for aggregating statistics (counters and timers), rolling them up, then sending them to graphite”. Graphite is described as “a highly scalable real-time graphing system. As a user, you write an application that collects numeric time-series data that you are interested i[...]. The data can then be visualized through graphite's web interfaces.” The way to implement these is available in several tutorials and I used StatsD own example C# client to poll our own API request log for API users, endpoints used, caching and errors. In the future it would be ideal for the application to access StatsD itself instead of running a polling daemon. There are a lot of usable features on Graphite. The ones I've used so far include Moving Average which will smooth out spikes in the graphs making it easier to see behaviour trends in a short time range and Sort by Maxima. There are even tools to forecast future behaviour and growth using Holt Winters Forecasting Statistics and this is used by companies to understand future scalability and performance requirements based on data from previous weeks, months or years (seen in this Etsy presentation on Metrics) How it looks and some findings Right away I got some usable results. An API client had a bug in their implementation which meant they required a specific endpoint more often than they would use it – this data can help out with debugging and also prevent abuse.

Sampled and smoothed usage per endpoint per API user...

Another useful graph is error rates, which might be linked with abuse, deploying new features or other causes.

 Error chart smoothed with a few spikes but even those are on the 0.001 % rate

Here is some useful caching information per endpoint to know how to tune up TTLs or look for stampede behaviour.

Sampled and smoothed Cache Miss per Endpoint

Opinion After you start using live data to provide feedback for your work there is no going back. It is my opinion that analysis of short and long term live results of any type of work should be mandatory as we move out of an environment that is small enough to be maintained exclusively by a team's knowledge.

Tag: 
Agile Development
Anonymous
Friday, July 17, 2015 - 20:18

by Alan Hannaway, 7digital Product Owner for Data 

We often ask ourselves How different do you think our listening experience will be in the next ten years? It’s a difficult question to answer, but a great one to ask. Serving an industry where there is constant change, the question brings us right back to where we should be focused: the way people experience music and radio.

Having powered music and radio services for over 10 years, 7digital knows how to deliver listening experiences that delight millions of people. We regularly reflect on what works, and what doesn’t. Sometimes it is clear what works well, and if you have a culture where you fail early and loudly (we do; it is part of our tech manifesto) you can sometimes see exactly what you did wrong. It’s not always easy though, and when the reason for something happening is not at all clear, finding out why it happened is difficult. How can you make sure the reasons you say something happened, are because of the reason you have identified? Correlation does not imply causation.

sharri.morris@7digital.com
Thursday, June 25, 2015 - 15:14

sharri.morris@7digital.com
Wednesday, May 27, 2015 - 17:21

We have updated the SolrNet repository so that the Structuremap implementation now allows for multi-core instances. Which can be set up in your Bootstrapper like this:

var solr = (SolrConfigurationSection)ConfigurationManager.GetSection(“solr”); var solrServers = solr.SolrServers; ObjectFactory.Initialize( x => x.AddRegistry(new SolrNetRegistry(solrServers)) );

 

You're app config should look like the following:

hack 24 logo
admin
Thursday, April 30, 2015 - 15:56

This Spring, on the 2nd and 3rd of May, 7digital are proudly sponsoring a new hack day, set up by the Tech Nottingham community - Hack24.

During this 24 hour coding competition, teams of 4 compete to win exclusive prizes, by showcasing their innovative ideas and raw tech talent!

Set in Nottingham's Creative Quarter, this will definitely be an exciting Hackathon to be a part of.

How to get involved?