Home

# Class goog.stats.BasicStat

Tracks basic statistics over a specified time interval. Statistics are kept in a fixed number of slots, each representing an equal portion of the time interval. Most methods optionally allow passing in the current time, so that higher level stats can synchronize operations on multiple child objects. Under normal usage, the default of goog.now() should be sufficient.

Instance Method Summary
| `checkForTimeTravel_(number now)` Checks that time never goes backwards. If it does (for example, the user changes their system clock), the object state is cleared.
| `get(number= opt_now) ⇒ number` Returns the count of the statistic over its configured time interval.
| `getInterval() ⇒ number`
| `getMax(number= opt_now) ⇒ number` Returns the magnitute of the largest atomic increment that occurred during the watched time interval.
| `getMin(number= opt_now) ⇒ number` Returns the magnitute of the smallest atomic increment that occurred during the watched time interval.
| `getSlotBoundary_(number time) ⇒ number` Computes the end time for the slot that should contain the count around the given time. This method ensures that every bucket is aligned on a "this.slotInterval_" millisecond boundary.
| `incBy(number amt, number= opt_now)` Increments the count of this statistic by the specified amount.
| `reduceSlots_((number|undefined) now, function (number, (goog.stats.BasicStat.Slot_|null)): number func, number val) ⇒ number` Passes each active slot into a function and accumulates the result.
| `reset_()` Clears any statistics tracked by this object, as though it were freshly created.

Static Method Summary
| `Slot_(number end)` A struct containing information for each sub-interval.