ArcObjects Library Reference (Server)  

IServerStatistics.GetAllStatisticsForTimeInterval Method

Gets a set of statistics, such as count, min, max, mean for an event (such as context usage time) for a specified time period.

[Visual Basic .NET]
Public Function GetAllStatisticsForTimeInterval ( _
    ByVal event As esriServerStatEvent, _
    ByVal period As esriServerTimePeriod, _
    ByVal index As Integer, _
    ByVal length As Integer, _
    ByVal Name As String, _
    ByVal Type As String, _
    ByVal Machine As String _
) As IStatisticsResults
[C#]
public IStatisticsResults GetAllStatisticsForTimeInterval (
    esriServerStatEvent event,
    esriServerTimePeriod period,
    int index,
    int length,
    string Name,
    string Type,
    string Machine
);
[C++]
HRESULT GetAllStatisticsForTimeInterval(
  esriServerStatEvent event,
  esriServerTimePeriod period,
  long index,
  long length,
  BSTR Name,
  BSTR Type,
  BSTR Machine,
  IStatisticsResults** ppResults
);
[C++]

Parameters

event [in]

  event is a parameter of type esriServerStatEvent

period [in]

  period is a parameter of type esriServerTimePeriod

index [in]   index is a parameter of type long length [in]   length is a parameter of type long Name [in]   Name is a parameter of type BSTR Type [in]   Type is a parameter of type BSTR Machine [in]   Machine is a parameter of type BSTR ppResults [out, retval]

  ppResults is a parameter of type IStatisticsResults

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

Use the GetAllStatisticsForTimeInterval to query the GIS server for all statistics for an event. For example you can use this method to get the sum, mean, etc of server contexts usage time for the last 2 days.

The server event is specified by the event argument, and the statistical function to qeury is specified by the function argument.

This method can be used to query based on the the events occuring in the server as a whole (i.e. accross all host machines), or for those occuring on a specific host machine. Additionally, these methods can be used to query based on the events using all server objects, or for events on a particular server object.

To specify a specific machine, specify its name for the machine argument. For all machines, use a blank string for the machine argument.

To specify a specific server object, specify its name for the Name argument and type for the Type argument. For all server objects, use a blank string for both name and type.

You specify the time interval for which you want to query using an index of time periods relative to the current time based on the time period described by esriServerTimePeriod. The index argument to the GetAllStatisticsForTimeInterval method describes the index of the time period to start from, and the length argument describes the number of time periods to query.

For example, to query for all statics in the last 2 hours, specify a time period of esriSTPHour, an index of 0 and a length of 2.

To query for all statistics since the server started, specify a time period of esriSTPNone, an index of 0 and a length of 1.

If you are unsure of the actual time period that the results of your query reflect, use the IServerTimeRange interface to get a report of the actual time period that your queries results reflect.

See Also

IServerStatistics Interface