title: Algorithms - Tracking latency of data from one service to another
body: <p>Say I subscribe to a service that gives me the temperature in my city and it sends data ticks sometimes really fast, sometimes in longer intervals.</p>
  
  <pre><code>Temp Timestamp (ms)
  20C 1
  21C 2
  20C 286
  21C 287
  21C 288
  21C 289
  20C 423
  etc.
  </code></pre>
  
  <p>Now lets say the subscriber service converts to Fahrenheit and republishes this data within my company, with it's own timestamp of when it does so.</p>
  
  <p>Caveat 1: Some ticks of data are dropped because some of the ticks come in faster than can be recalculated to Fahrenheit, so it will take the latest value in the Queue.</p>
  
  <p>Caveat 2: The Fahrenheit data published may take "longer" (ie. have higher latency) if a lot of ticks come in reducing available bandwidth.</p>
  
  <pre><code>Temp Timestamp (ms)
  68F 2:00:00:0001
  69F 2:00:00:0023
  68F 2:00:00:0063
  etc..
  </code></pre>
  
  <hr>
  
  <p>What would be the best way to "match" the possible corresponding ticks and calculate a latency between the two services? Would it be better to report two latencies? One during high load and one during standard load? If so, how do I determine when high load is? When some latency values are certain std deviations away?</p>