<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Coding the Architecture - metrics tag</title>
  <link>http://www.codingthearchitecture.com/tags/metrics/</link>
  <description>Software architecture for developers</description>
  <language>en</language>
  <copyright>Coding the Architecture</copyright>
  <lastBuildDate>Wed, 16 May 2012 08:01:04 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Architectural Assumptions</title>
    <link>http://www.codingthearchitecture.com/2007/12/24/architectural_assumptions.html</link>
    
      
        <description>
          &lt;p&gt;
Most of the systems I&#039;ve worked on in the recent past have been latency rather than throughput orientated. However my current project is definitely throughput focused and scales horizontally rather than vertically (this is a simplification but basically correct).
&lt;/p&gt;
&lt;p&gt;
This has lead to me making a few errors based on my incorrect assumptions. As you may have read I&#039;ve been retrofitting performance metrics, we&#039;re trying to discover the level of overhead compared to &#039;real&#039; work, so I&#039;ve been running a single node on my machine to determine the outputs required for statistics. I wanted to write the results to a database and the DBA asked me to produce an estimate of the load in production before he would create my table structures. Cursing the formality of DBAs, I made some calculations based on the number of tasks and the metrics for each. The number I came up with was huge and the DBA almost coughed up his breakfast.
&lt;/p&gt;
&lt;p&gt;
I was surprised by the number because I had failed to realise that my local test was NOT representative of the real system. If the application was vertically scaled then the quantity of metrics in production would be (roughly) the same as on my desktop PC but this application runs across hundreds of grid machines and each one would output these metrics.
&lt;/p&gt;
&lt;p&gt;
I had just designed a distributed denial of service attack on our own database server. The solution was quite simple - I got the machines that aggregate the outputs to also aggregate the performance metrics. This reduced the load by a couple of orders of magnitude.
&lt;/p&gt;
&lt;p&gt;
I think this is a good example of what happens when you fail to take into account the architecture of a system when writing code. All developers need to be aware of the architecure and how it effects the code they are writing. Does anyone else have similar experiences?
&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>How do you define software architecture?</category>
    
    <comments>http://www.codingthearchitecture.com/2007/12/24/architectural_assumptions.html#comments</comments>
    <guid isPermaLink="true">http://www.codingthearchitecture.com/2007/12/24/architectural_assumptions.html</guid>
    <pubDate>Mon, 24 Dec 2007 12:44:59 GMT</pubDate>
  </item>
  
  <item>
    <title>What is Significant?</title>
    <link>http://www.codingthearchitecture.com/2007/12/15/what_is_significant.html</link>
    
      
        <description>
          &lt;p&gt;
Recently I wrote a quick blog about taking metrics for optimisation. I suggested they should only be included if the improvement was significant, but how do you define significant?
&lt;/p&gt;

&lt;p&gt;
You may think that &#039;significant&#039; is just a matter of opinion but it actually has a very specific meaning in statistics - 

&lt;a href=&#034;http://en.wikipedia.org/wiki/Statistical_significance&#034;&gt;Wikipedia &#039;s Description&lt;/a&gt;. You can have a read through the maths but it basically comes down to &#034;a result is called statistically significant if it is unlikely to have occurred by chance&#034;.
&lt;/p&gt;

&lt;p&gt;
This is really important and something that performance testers and optimisers often forget. For example...
&lt;/p&gt;
&lt;p&gt;
Imagine that you perform some kind of performance test on your system or code. This could be anything e.g. latency response timings, throughput per time unit etc but we&#039;ll assume for this that it&#039;s units processed in 10 minutes. The figure you get is  20. You spend a day modifying a piece of code you think will affect the performance, retest and get 22. A 10% improvement - pretty good.
&lt;/p&gt;
&lt;p&gt;
You hand the new code over to a colleague who also does a test. She says that it&#039;s worse by 5%. Slander! You take it to your boss who says there is no difference...
&lt;/p&gt;
&lt;p&gt;
What we&#039;ve done is perform three tests on the old and new system. Lets list them and perform seven others as well:
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
Old: 20 20 22 19 19 21 19 19 19 22
New: 22	19 22 20 20 19 19 19 21 19
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Now it&#039;s obvious what happened (although it probably was before). Your test does not produce constant figures even without changes. Both have a range of 3 (19-22), an average of 20 and a variance of 1.55
&lt;/p&gt;
&lt;p&gt;
If you had performed ten runs on the original code first you would have realised that a single result of 22 for the new code is not significant as it&#039;s within the range of the previous figures.
&lt;/p&gt;
&lt;p&gt;
Performing the test multiple times on the new code would increase your confidence that it&#039;s a significant change. You can test this statistically (but the maths is beyond the scope of this blog entry).
&lt;/p&gt;
&lt;p&gt;
Just to leave you with a challenge, the project I&#039;m currently working has a task that we wish to optimise but it takes ten hours to run even on a grid of several hundreds machines. How do we run realistic, pre-production tests that we know are statistically significant?
&lt;/p&gt;

        </description>
      
      
    
    
    
    <category>How do you deliver software architecture?</category>
    
    <comments>http://www.codingthearchitecture.com/2007/12/15/what_is_significant.html#comments</comments>
    <guid isPermaLink="true">http://www.codingthearchitecture.com/2007/12/15/what_is_significant.html</guid>
    <pubDate>Sat, 15 Dec 2007 21:15:27 GMT</pubDate>
  </item>
  
  <item>
    <title>Code Metrics</title>
    <link>http://www.codingthearchitecture.com/2006/12/15/code_metrics.html</link>
    
      
      
        <description>
          &lt;p&gt;There&#039;s nothing particularly new about code metrics but they perhaps have an increasing relevance as development teams become geographically and ideologically separated from those charged with code quality and an increasing degree of freedom is granted to Agile development teams which should be both monitored and publicised.&lt;/p&gt;
&lt;p&gt;In this article I&#039;ll discuss my recent experiences with metrics ranging from simple line counts to complexity, duplication and test coverage.&lt;/p&gt;&lt;p&gt;&lt;a href=&#034;http://www.codingthearchitecture.com/2006/12/15/code_metrics.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;
        </description>
      
    
    
    
    <category>How do you deliver software architecture?</category>
    
    <comments>http://www.codingthearchitecture.com/2006/12/15/code_metrics.html#comments</comments>
    <guid isPermaLink="true">http://www.codingthearchitecture.com/2006/12/15/code_metrics.html</guid>
    <pubDate>Fri, 15 Dec 2006 13:40:00 GMT</pubDate>
  </item>
  
  </channel>
</rss>

