Public Types | Public Member Functions

nsChannelStatistics Class Reference

This class is useful for estimating rates of data passing through some channel. More...

#include <nsMediaStream.h>

Collaboration diagram for nsChannelStatistics:

List of all members.

Public Types

typedef mozilla::TimeStamp TimeStamp
typedef mozilla::TimeDuration TimeDuration

Public Member Functions

 nsChannelStatistics ()
void Reset ()
void Start (TimeStamp aNow)
void Stop (TimeStamp aNow)
void AddBytes (PRInt64 aBytes)
double GetRateAtLastStop (PRPackedBool *aReliable)
double GetRate (TimeStamp aNow, PRPackedBool *aReliable)

Detailed Description

This class is useful for estimating rates of data passing through some channel.

The idea is that activity on the channel "starts" and "stops" over time. At certain times data passes through the channel (usually while the channel is active; data passing through an inactive channel is ignored). The GetRate() function computes an estimate of the "current rate" of the channel, which is some kind of average of the data passing through over the time the channel is active.

All methods take "now" as a parameter so the user of this class can control the timeline used.


Member Typedef Documentation


Constructor & Destructor Documentation

nsChannelStatistics::nsChannelStatistics (  )  [inline]

Member Function Documentation

void nsChannelStatistics::AddBytes ( PRInt64  aBytes  )  [inline]
double nsChannelStatistics::GetRate ( TimeStamp  aNow,
PRPackedBool aReliable 
) [inline]
double nsChannelStatistics::GetRateAtLastStop ( PRPackedBool aReliable  )  [inline]
void nsChannelStatistics::Reset (  )  [inline]
void nsChannelStatistics::Start ( TimeStamp  aNow  )  [inline]
void nsChannelStatistics::Stop ( TimeStamp  aNow  )  [inline]

The documentation for this class was generated from the following file: