@svta/common-media-library
Version:
A common library for media playback in JavaScript
29 lines • 778 B
TypeScript
/**
* Exponential Weighted Moving Average (EWMA)
*
* @group Throughput
*
* @beta
*/
export declare class Ewma {
private alpha;
private estimate;
private totalDuration;
constructor(alpha: number);
/**
* Samples the value of the resource and updates the estimate.
*/
sample(weight: number, value: number): void;
/**
* Returns the estimate of the value (in units, as `value` during sampling)
*
* For example, if the value is throughput (in bits per seconds), the estimate
* will also be in bits per seconds.
*/
getEstimate(): number;
/**
* Returns the total duration of the resource (in units, as `weight` during sampling)
*/
getTotalDuration(): number;
}
//# sourceMappingURL=Ewma.d.ts.map