Skip to main content

Averager

A running average stored under key: add(value), get(), pop().

Usage

Source

Averager(
    cache,
    key,
    expire=None,
    tag=None,
)

The total and count are updated together in one transaction, so every thread and process adding to it agrees. None while nothing has been added.

Methods

Name Description
add() Add value to the average.
get() The current average, or None if nothing has been added.
pop() The current average, removing it.

add()

Add value to the average.

Usage

Source

add(value)

get()

The current average, or None if nothing has been added.

Usage

Source

get()

pop()

The current average, removing it.

Usage

Source

pop()