This repository was archived by the owner on Sep 4, 2024. It is now read-only.
  
  
  - 
                Notifications
    You must be signed in to change notification settings 
- Fork 652
Perf Counters exposed as environment variables
        David Ebbo edited this page Apr 5, 2018 
        ·
        1 revision
      
    The following are 'fake' Environment Variables that don't exist if you enumerate them, but return their value if you look them up individually. The value is dynamic and can change on every lookup.
- 
WEBSITE_COUNTERS_ASPNET- Returns a JSON object containing the ASP.NET perf counters.
- 
WEBSITE_COUNTERS_APP- Returns a JSON object containing sandbox counters.
- 
WEBSITE_COUNTERS_CLR- Returns a JSON object containing CLR counters.
- 
WEBSITE_COUNTERS_ALL- Returns a JSON object containing the combination of the other three.
Here is an example of what you would get by evaluating WEBSITE_COUNTERS_ALL:
{
  "aspNet": {
    "applicationRestarts": 0,
    "applicationsRunning": 0,
    "requestsDisconnected": 0,
    "requestExecutionTime": 0,
    "requestsRejected": 0,
    "requestsQueued": 0,
    "wpsRunning": 0,
    "wpsRestarts": 0,
    "requestWaitTime": 0,
    "requestsCurrent": 0,
    "globalAuditSuccess": 0,
    "globalAuditFail": 0,
    "globalEventsError": 0,
    "globalEventsHttpReqError": 0,
    "globalEventsHttpInfraError": 0,
    "requestsInNativeQueue": 0,
    "anonymousRequests": 0,
    "totalCacheEntries": 0,
    "totalCacheTurnoverRate": 0,
    "totalCacheHits": 0,
    "totalCacheMisses": 0,
    "totalCacheRatioBase": 0,
    "apiCacheEntries": 0,
    "apiCacheTurnoverRate": 0,
    "apiCacheHits": 0,
    "apiCacheMisses": 0,
    "apiCacheRatioBase": 0,
    "outputCacheEntries": 0,
    "outputCacheTurnoverRate": 0,
    "outputCacheHits": 0,
    "outputCacheMisses": 0,
    "outputCacheRatioBase": 0,
    "compilations": 0,
    "debuggingRequests": 0,
    "errorsPreProcessing": 0,
    "errorsCompiling": 0,
    "errorsDuringRequest": 0,
    "errorsUnhandled": 0,
    "errorsTotal": 0,
    "pipelines": 0,
    "requestBytesIn": 0,
    "requestBytesOut": 0,
    "requestsExecuting": 0,
    "requestsFailed": 0,
    "requestsNotFound": 0,
    "requestsNotAuthorized": 0,
    "requestsInApplicationQueue": 0,
    "requestsTimedOut": 0,
    "requestsSucceded": 0,
    "requestsTotal": 0,
    "sessionsActive": 0,
    "sessionsAbandoned": 0,
    "sessionsTimedOut": 0,
    "sessionsTotal": 0,
    "transactionsAborted": 0,
    "transactionsCommitted": 0,
    "transactionsPending": 0,
    "transactionsTotal": 0,
    "sessionStateServerConnections": 0,
    "sessionSqlServerConnections": 0,
    "eventsTotal": 0,
    "eventsApp": 0,
    "eventsError": 0,
    "eventsHttpReqError": 0,
    "eventsHttpInfraError": 0,
    "eventsWebReq": 0,
    "auditSuccess": 0,
    "auditFail": 0,
    "memberSuccess": 0,
    "memberFail": 0,
    "formsAuthSuccess": 0,
    "formsAuthFail": 0,
    "viewstateMacFail": 0,
    "appRequestExecTime": 0,
    "appRequestDisconnected": 0,
    "appRequestsRejected": 0,
    "appRequestWaitTime": 0,
    "cachePercentMachMemLimitUsed": 0,
    "cachePercentMachMemLimitUsedBase": 0,
    "cachePercentProcMemLimitUsed": 0,
    "cachePercentProcMemLimitUsedBase": 0,
    "cacheTotalTrims": 0,
    "cacheApiTrims": 0,
    "cacheOutputTrims": 0,
    "appCpuUsed": 0,
    "appCpuUsedBase": 0,
    "appMemoryUsed": 0,
    "requestBytesInWebsockets": 0,
    "requestBytesOutWebsockets": 0,
    "requestsExecutingWebsockets": 0,
    "requestsFailedWebsockets": 0,
    "requestsSucceededWebsockets": 0,
    "requestsTotalWebsockets": 0
  },
  "app": {
    "userTime": 65625000,
    "kernelTime": 38750000,
    "pageFaults": 175585,
    "processes": 2,
    "processLimit": 32,
    "threads": 37,
    "threadLimit": 512,
    "connections": 0,
    "connectionLimit": 300,
    "sections": 3,
    "sectionLimit": 256,
    "namedPipes": 2,
    "namedPipeLimit": 128,
    "readIoOperations": 2485,
    "writeIoOperations": 859,
    "otherIoOperations": 38155,
    "readIoBytes": 7715020,
    "writeIoBytes": 5850202,
    "otherIoBytes": 1899661,
    "privateBytes": 19206144,
    "handles": 2408,
    "contextSwitches": 365042,
    "remoteOpens": 3196,
    "remoteWrites": 47,
    "remoteWriteKBs": 952
  },
  "clr": {
    "bytesInAllHeaps": 0,
    "gcHandles": 0,
    "gen0Collections": 0,
    "gen1Collections": 0,
    "gen2Collections": 0,
    "inducedGC": 0,
    "pinnedObjects": 0,
    "committedBytes": 0,
    "reservedBytes": 0,
    "timeInGC": 0,
    "timeInGCBase": 0,
    "allocatedBytes": 0,
    "gen0HeapSize": 0,
    "gen1HeapSize": 0,
    "gen2HeapSize": 0,
    "largeObjectHeapSize": 0,
    "currentAssemblies": 0,
    "currentClassesLoaded": 0,
    "exceptionsThrown": 0,
    "appDomains": 0,
    "appDomainsUnloaded": 0
  }
}