ArcObjects Library Reference (Server)  

IServerStatistics Interface

Provides access to members that report statistics for a GIS server to administrators.

Product Availability

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

Members

Description
Method GetAllStatisticsForTimeInterval Gets a set of statistics, such as count, min, max, mean for an event (such as context usage time) for a specified time period.
Method GetSpecificStatisticForTimeIntervals Gets a specific statistic (such as total count of server contexts created) for a specified time period.
Method Reset Clears out the currently gathered statistics.

CoClasses that implement IServerStatistics

CoClasses and Classes Description
ServerObjectAdmin The ServerObjectAdmin object which administrates the GIS Server.

Remarks

As the GIS server creates and destroys server objects, handles client requests and so on, statistics about these events are logged in the GIS server's logs. In addition to the log, statistics are also kept in memory and can be queried using the IServerStatistcs interface. The IServerStatistics interface is a supported interface on ServerObjectAdmin.

You can query the GIS server for statistics on the following events described by esriServerStatEvent:

Value Description

esriSSEContextCreated

A client made a call to CreateServerContext on IServerObjectManager and got a reference to a server context.

esriSSEContextCreationFailed

CreateServerContext failed due to an error. Errors will be logged in tht e GIS server's log files.

esriSSEContextCreationTimeout

CreateServerContext timed out because there we no available server objects for the requested configuration for a duration linger than the server object configuration's WaitTimeout.

esriSSEContextReleased

A client released the server context by calling ReleaseServerContext. The time measured is the time the client held onto the context (the time between when they called CreateServerContext and got a reference to the server context, and the time they released the context by calling ReleaseServerContext).

esriSSEContextUsageTimeout

A client did not release the server context by calling ReleaseServerContext before the context's server object configuration's UsageTimeout was reached.

esriSSEServerObjectCreated

A new server object was created. This can happen when a pooled configuration is started and the object pool is populated, when a server object is recycled, or in response to a call to CreateServerContext. The time measured is the time to create the server object instance.

esriSSEServerObjectCreationFailed

The creation of a new server object instance failed due to an error. Errors will be logged in tht e GIS server's log files.

 

You can query these events using the statistical functions described by esriServerStatFunction :

esriSSFCount
esriSSFMinimum
esriSSFMaximum
esriSSFSum
esriSSFSumSquares
esriSSFMean
esriSSFStandardDeviation

Note: for esriSSEContextCreationFailed, esriSSEContextCreationTimeout, esriSSEContextUsageTimeout and esriSSEServerObjectCreationFailed , the only relevant statistical function is esriSSFCount , as these events do not have time associated with them. The other functions reflect the statistics of the elapsed time associated with the event.

While the GIS server's logs maintain a record of all events in the server, the set of statistics that are in memory and that can be queried are accumulated summaries of time slices since the GIS server was started. The granularity of these time slices is more coarse the futher back in time you go. These statistics can be queried for the following time intervals:

Each time period is an accumulated total of the statistics for that time period. For example, if you query for the total number of request to create server contexts for the last 30 days, you would get statistics from now to the begning of the day 30 days ago (not to the current time on that day). This is because the in memory statistcs have been combined for that entire day.

This means that you may actually get statistics for a longer period that you speficied in your query. When you query the GIS server for statistics, you can use the IServerTimeRange interface to get a report of the actual time period that your queries results reflect.

The IServerStatistics interface has methods for querying a specific statistical function for an event, or for querying all statistical functions for an event:

Use the GetSpecificStatisticForTimeIntervals  method to query the GIS server for a specific statistic for an event at descrete time intervals. For example you can use this method to get the count of all server contexts that were created for each minute of the last hour.

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.

These methods 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.

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 GetSpecificStatisticForTimeIntervals and GetAllStatisticsForTimeInterval methods 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.

Use the Reset method to clear the statistics in memory.