Comments on: How to subtract in SQL over samples that wrap http://www.xaprb.com/blog/2007/02/19/how-to-subtract-in-sql-over-samples-that-wrap/ Stay curious! Mon, 13 May 2013 05:55:40 +0000 hourly 1 http://wordpress.org/?v=3.5.1 By: Bill Minton http://www.xaprb.com/blog/2007/02/19/how-to-subtract-in-sql-over-samples-that-wrap/#comment-4224 Bill Minton Tue, 20 Feb 2007 21:08:28 +0000 http://www.xaprb.com/blog/?p=300#comment-4224 Oh ok, you’re sampling it. I was trying to figure out why it would write out a value lower than it’s threshold.

Now I’ll have to re-read the article with a little better understanding. :)

]]>
By: Xaprb http://www.xaprb.com/blog/2007/02/19/how-to-subtract-in-sql-over-samples-that-wrap/#comment-4223 Xaprb Tue, 20 Feb 2007 20:48:47 +0000 http://www.xaprb.com/blog/?p=300#comment-4223 Bill, thanks for writing in. It absolutely could wrap more than once. However, in real life, most things I know of (like traffic through a network interface) wrap at some large number, such as the size of an unsigned integer. If you sample it often enough, you should be able to get a fairly smooth curve and very low probability of two wraps in one. For example, if you know your counter increases at 1000 per second and you sample every second, there’s no way two wraps could sneak past you.

The value didn’t wrap at 900; I sampled it at 900, it increased to 1000 and back to 230 before I sampled it again.

]]>
By: Bill Minton http://www.xaprb.com/blog/2007/02/19/how-to-subtract-in-sql-over-samples-that-wrap/#comment-4203 Bill Minton Tue, 20 Feb 2007 14:30:44 +0000 http://www.xaprb.com/blog/?p=300#comment-4203 I don’t guess I’m really getting this. What’s to say a value can’t be wrapped more than once? Also, what would cause it to wrap at 900 when the upper limit is 1000?

]]>
By: Sheeri http://www.xaprb.com/blog/2007/02/19/how-to-subtract-in-sql-over-samples-that-wrap/#comment-4194 Sheeri Mon, 19 Feb 2007 22:19:50 +0000 http://www.xaprb.com/blog/?p=300#comment-4194 This is particularly useful for me, as I take some OS and MySQL statistics every 5 minutes, and MySQL has counters that reset upon restart as well as roll over when they pass a certain number. So it’s useful to be able to have this — in case anyone is wondering, “why would I use this”?

]]>