The NetScaler appliance collects statistics about the usage of its features and the corresponding resources. You can retrieve these statistics by using NITRO API. The statistics APIs are available in different namespaces from the configuration APIs.
The APIs to retrieve statistics of NetScaler features are available in namespaces that have the following pattern: com.citrix.netscaler.nitro.resource.stat.<feature>.
For example, APIs to retrieve statistics of the load balancing virtual server are available in the com.citrix.netscaler.nitro.resource.stat.lb namespace.
The following sample code retrieves the statistics of a load balancing virtual server and displays some of the statistics returned:
lbvserver_stats stats = lbvserver_stats.get(ns_session,"MyFirstLbVServer"); Console.WriteLine(stats.curclntconnections); Console.WriteLine(stats.deferredreqrate);