MetricsProvider.accumulate.event(event: CountlyEvent, flush: boolean)
// event can be indexed by key,
// flush forces a flush to event queue.
accumulatedEvents = Record<key: string, event: CountlyEvent>;
Internally, events can be represented as a hash-map of events by key where:
count represents the sum of count from each event.
sum represents the sum of events accumulated.
dur represents the duration over which the events were accumulated, defaults to 5 mins, but can be flushed earlier using flush param.
Optionally, an additional helper method can be provided to force flush the accumulated events synchronously. which can be hooked on the beforunload event.
MetricsProvider.accumulate.flush(key: string)
// this method is called when flush is set to true in `event` call.
// this will be a synchronous call:
Countly.add_event(accumulatedEvents[key])
Countly allows:
a new interface needs to be added:
Internally, events can be represented as a hash-map of events by key where:
count
represents the sum ofcount
from each event.sum
represents the sum of events accumulated.dur
represents the duration over which the events were accumulated, defaults to 5 mins, but can be flushed earlier usingflush
param.Optionally, an additional helper method can be provided to force flush the accumulated events synchronously. which can be hooked on the
beforunload
event.