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 packages from the configuration APIs.
The APIs to retrieve statistics of NetScaler features are available in packages that have the following pattern: nssrc.com.citrix.netscaler.nitro.resource.stat.<feature>.
For example, APIs to retrieve statistics of the load balancing virtual server are available in the nssrc.com.citrix.netscaler.nitro.resource.stat.lb package.
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") print(stats.curclntconnections) print(stats.deferredreqrate)