It works like this...
Minutes_to_Average = 5
Delta = 60 * 5
Current_Shares = The total number of shares submitted in the round
Shares_Before_Delta = Shares submitted before Delta-seconds ago
Total_Hash/s = (((Current_Shares - Shares_Before_Delta) * 2^32) / Delta)
Ghash/s = (((Total_Hash/s / 1000) / 1000) / 1000)
I was inclined to believe this was true, but upon further thought, I don't think so anymore. Each share is simply some hash that's below the minimum difficulty. There can be 0, 1, 2, or more of these hashes in a single getwork response. While a getwork response is worth 2**32 hashes of work, a share isn't necessarily worth that much.
Looking at how other pool calculate their hash speeds, it seems they assume each getwork has, at least on average, a single valid share.
Is there a way to find which getwork created a share? That way, I can disregard double-share getworks and have a more realistic pool measure.