Table of Contents

Class Stat<TAction>

Namespace
Ecng.ComponentModel
Assembly
Ecng.ComponentModel.dll

Provides statistical tracking for actions.

public class Stat<TAction>

Type Parameters

TAction

The type representing the action.

Inheritance
Stat<TAction>
Inherited Members
Extension Methods

Constructors

Stat()

public Stat()

Properties

FreqLimit

Gets or sets the maximum number of frequency records to keep.

public int FreqLimit { get; set; }

Property Value

int

LongestLimit

Gets or sets the maximum number of longest duration records to keep.

public int LongestLimit { get; set; }

Property Value

int

Methods

Begin(TAction, IPAddress)

Starts tracking an action.

public Stat<TAction>.Item Begin(TAction action, IPAddress address)

Parameters

action TAction

The action to track.

address IPAddress

The IP address associated with the action.

Returns

Stat<TAction>.Item

An Stat<TAction>.Item that represents the action tracking session.

Exceptions

ArgumentNullException

Thrown when action or address is null.

Clear()

Clears all the recorded statistics.

public void Clear()

GetInfo(int, int)

Retrieves statistical information with support for paging.

public StatInfo<TAction> GetInfo(int skip, int take)

Parameters

skip int

The number of records to skip.

take int

The number of records to take.

Returns

StatInfo<TAction>

A StatInfo<TAction> structure containing the current statistics.