/// <summary> /// Initializes the counter instances and category. /// </summary> public void InitializePerfCounters() { lock (this) { _pcRequestsPerSec = new RateOfCounter(CustomCounterNames.RequestsPerSec, _instanceName); _pcResponsesPerSec = new RateOfCounter(CustomCounterNames.ResponsesPerSec, _instanceName); _pcClientBytesSentPerSec = new RateOfCounter(CustomCounterNames.ClientBytesSentPerSec, _instanceName); _pcClientBytesReceiedPerSec = new RateOfCounter(CustomCounterNames.ClientBytesReceiedPerSec, _instanceName); _pcMsecPerCacheOperation = new AverageCounter(CustomCounterNames.MsecPerCacheOperation, _instanceName); _pcMsecPerCacheOperationBase = new RateOfCounter(CustomCounterNames.MsecPerCacheOperationBase, _instanceName); _usMsecPerCacheOperation = new UsageStats(); _nsMsecPerCacheOperation = new NanoSecTimeStats(); _pcResponseQueueCount = new NumberOfItemCounter(CustomCounterNames.ResponseQueueCount, _instanceName); _pcResponseQueueSize = new NumberOfItemCounter(CustomCounterNames.ResponseQueueSize, _instanceName); _pcEventQueueCount = new NumberOfItemCounter(CustomCounterNames.EventQueueCount, _instanceName); _requestLogPerSecond = new RateOfCounter(CustomCounterNames.RequestLogPerSecond, _instanceName); _requestLogSize = new NumberOfItemCounter(CustomCounterNames.RequestLogSize, _instanceName); _pcConnectedClients = new NumberOfItemCounter(CustomCounterNames.ConnectedClients, _instanceName); //Bulk CustomCounterNames _pcMsecPerAddBulkAvg = new RateOfCounter(CustomCounterNames.MsecPerAddBulkAvg, _instanceName); _pcMsecPerGetBulkAvg = new RateOfCounter(CustomCounterNames.MsecPerGetBulkAvg, _instanceName); _pcMsecPerUpdBulkAvg = new RateOfCounter(CustomCounterNames.MsecPerUpdBulkAvg, _instanceName); _pcMsecPerDelBulkAvg = new RateOfCounter(CustomCounterNames.MsecPerDelBulkAvg, _instanceName); _pcMsecPerAddBulkBase = new RateOfCounter(CustomCounterNames.MsecPerAddBulkBase, _instanceName); _pcMsecPerGetBulkBase = new RateOfCounter(CustomCounterNames.MsecPerGetBulkBase, _instanceName); _pcMsecPerUpdBulkBase = new RateOfCounter(CustomCounterNames.MsecPerUpdBulkBase, _instanceName); _pcMsecPerDelBulkBase = new RateOfCounter(CustomCounterNames.MsecPerDelBulkBase, _instanceName); } }
/// <summary> /// Initializes the counter instances and category. /// </summary> public void InitializePerfCounters() { try { if (!UserHasAccessRights) { return; } lock (this) { _pcRequestsPerSec = new PerformanceCounter(PC_CATEGORY, "Requests/sec", _instanceName, false); _pcResponsesPerSec = new PerformanceCounter(PC_CATEGORY, "Responses/sec", _instanceName, false); _pcClientBytesSentPerSec = new PerformanceCounter(PC_CATEGORY, "Client bytes sent/sec", _instanceName, false); _pcClientBytesReceiedPerSec = new PerformanceCounter(PC_CATEGORY, "Client bytes received/sec", _instanceName, false); _pcMsecPerCacheOperation = new PerformanceCounter(PC_CATEGORY, "Average �s/cache operation", _instanceName, false); _pcMsecPerCacheOperationBase = new PerformanceCounter(PC_CATEGORY, "Average �s/cache operation base", _instanceName, false); _usMsecPerCacheOperation = new UsageStats(); _nsMsecPerCacheOperation = new NanoSecTimeStats(); _generalNotificationQueueSize = new PerformanceCounter(PC_CATEGORY, "General Notifications Queue Size", _instanceName, false); _pcResponseQueueCount = new PerformanceCounter(PC_CATEGORY, "Response Queue Count", _instanceName, false); _pcResponseQueueSize = new PerformanceCounter(PC_CATEGORY, "Response Queue Size", _instanceName, false); _pcEventQueueCount = new PerformanceCounter(PC_CATEGORY, "Event Queue Count", _instanceName, false); } } catch (Exception e) { AppUtil.LogEvent("NCache", "An error occured while initializing counters for NCache Server. " + e.ToString(), EventLogEntryType.Error, EventCategories.Error, EventID.GeneralError); } }
/// <summary> /// Initializes the counter instances and category. /// </summary> public void InitializePerfCounters() { #if NETCORE if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux)) { return; } #endif try { if (!UserHasAccessRights) { return; } lock (this) { _pcRequestsPerSec = new PerformanceCounter(PC_CATEGORY, "Requests/sec", _instanceName, false); _pcResponsesPerSec = new PerformanceCounter(PC_CATEGORY, "Responses/sec", _instanceName, false); _pcClientBytesSentPerSec = new PerformanceCounter(PC_CATEGORY, "Client bytes sent/sec", _instanceName, false); _pcClientBytesReceiedPerSec = new PerformanceCounter(PC_CATEGORY, "Client bytes received/sec", _instanceName, false); _pcMsecPerCacheOperation = new PerformanceCounter(PC_CATEGORY, "Average us/cache operation", _instanceName, false); _pcMsecPerCacheOperationBase = new PerformanceCounter(PC_CATEGORY, "Average us/cache operation base", _instanceName, false); _usMsecPerCacheOperation = new UsageStats(); _nsMsecPerCacheOperation = new NanoSecTimeStats(); _generalNotificationQueueSize = new PerformanceCounter(PC_CATEGORY, "General Notifications Queue Size", _instanceName, false); _pcResponseQueueCount = new PerformanceCounter(PC_CATEGORY, "Response Queue Count", _instanceName, false); _pcResponseQueueSize = new PerformanceCounter(PC_CATEGORY, "Response Queue Size", _instanceName, false); _pcEventQueueCount = new PerformanceCounter(PC_CATEGORY, "Event Queue Count", _instanceName, false); _requestLogPerSecond = new PerformanceCounter(PC_CATEGORY, "Requests Logged/sec", _instanceName, false); _requestLogSize = new PerformanceCounter(PC_CATEGORY, "Request Log Ledger Size", _instanceName, false); _pcConnectedClients = new PerformanceCounter(PC_CATEGORY, "# Clients", _instanceName, false); //Bulk Counters _pcMsecPerAddBulkAvg = new PerformanceCounter(PC_CATEGORY, "Average us/addbulk", _instanceName, false); _pcMsecPerGetBulkAvg = new PerformanceCounter(PC_CATEGORY, "Average us/fetchbulk", _instanceName, false); _pcMsecPerUpdBulkAvg = new PerformanceCounter(PC_CATEGORY, "Average us/insertbulk", _instanceName, false); _pcMsecPerDelBulkAvg = new PerformanceCounter(PC_CATEGORY, "Average us/removebulk", _instanceName, false); _pcMsecPerAddBulkBase = new PerformanceCounter(PC_CATEGORY, "Average us/addbulk base", _instanceName, false); _pcMsecPerGetBulkBase = new PerformanceCounter(PC_CATEGORY, "Average us/fetchbulk base", _instanceName, false); _pcMsecPerUpdBulkBase = new PerformanceCounter(PC_CATEGORY, "Average us/insertbulk base", _instanceName, false); _pcMsecPerDelBulkBase = new PerformanceCounter(PC_CATEGORY, "Average us/removebulk base", _instanceName, false); } } catch (Exception e) { AppUtil.LogEvent("NCache", "An error occurred while initializing counters for NCache Server. " + e.ToString(), EventLogEntryType.Error, EventCategories.Error, EventID.GeneralError); //nTrace.warn("SocketServer.PerfStatsCollector.PerfStatsCollector()", e.ToString()); } }
/// <summary> /// Initializes the counter instances and category. /// </summary> public void InitializePerfCounters() { try { if (!UserHasAccessRights) { return; } lock (this) { _pcRequestsPerSec = new PerformanceCounter(PC_CATEGORY, "Requests/sec", _instanceName, false); _pcResponsesPerSec = new PerformanceCounter(PC_CATEGORY, "Responses/sec", _instanceName, false); _pcClientBytesSentPerSec = new PerformanceCounter(PC_CATEGORY, "Client bytes sent/sec", _instanceName, false); _pcClientBytesReceiedPerSec = new PerformanceCounter(PC_CATEGORY, "Client bytes received/sec", _instanceName, false); _pcMsecPerCacheOperation = new PerformanceCounter(PC_CATEGORY, "Average us/cache operation", _instanceName, false); _pcMsecPerCacheOperationBase = new PerformanceCounter(PC_CATEGORY, "Average us/cache operation base", _instanceName, false); _usMsecPerCacheOperation = new UsageStats(); _nsMsecPerCacheOperation = new NanoSecTimeStats(); _generalNotificationQueueSize = new PerformanceCounter(PC_CATEGORY, "General Notifications Queue Size", _instanceName, false); _pcResponseQueueCount = new PerformanceCounter(PC_CATEGORY, "Response Queue Count", _instanceName, false); _pcResponseQueueSize = new PerformanceCounter(PC_CATEGORY, "Response Queue Size", _instanceName, false); _pcEventQueueCount = new PerformanceCounter(PC_CATEGORY, "Event Queue Count", _instanceName, false); _requestLogCount = new PerformanceCounter(PC_CATEGORY, "Logged Request Count", _instanceName, false); _requestLogPerSecond = new PerformanceCounter(PC_CATEGORY, "Requests Logged/sec", _instanceName, false); _requestLogSize = new PerformanceCounter(PC_CATEGORY, "Request Log Ledger Size", _instanceName, false); // Bulk Counters _pcMsecPerAddBulkAvg = new PerformanceCounter(PC_CATEGORY, "Average us/addbulk", _instanceName, false); _pcMsecPerGetBulkAvg = new PerformanceCounter(PC_CATEGORY, "Average us/fetchbulk", _instanceName, false); _pcMsecPerUpdBulkAvg = new PerformanceCounter(PC_CATEGORY, "Average us/insertbulk", _instanceName, false); _pcMsecPerDelBulkAvg = new PerformanceCounter(PC_CATEGORY, "Average us/removebulk", _instanceName, false); _pcMsecPerAddBulkBase = new PerformanceCounter(PC_CATEGORY, "Average us/addbulk base", _instanceName, false); _pcMsecPerGetBulkBase = new PerformanceCounter(PC_CATEGORY, "Average us/fetchbulk base", _instanceName, false); _pcMsecPerUpdBulkBase = new PerformanceCounter(PC_CATEGORY, "Average us/insertbulk base", _instanceName, false); _pcMsecPerDelBulkBase = new PerformanceCounter(PC_CATEGORY, "Average us/removebulk base", _instanceName, false); } } catch (Exception e) { #if JAVA AppUtil.LogEvent("TayzGrid", "An error occurred while initializing counters for TayzGrid Server. " + e.ToString(), EventLogEntryType.Error, EventCategories.Error, EventID.GeneralError); #else AppUtil.LogEvent("NCache", "An error occurred while initializing counters for NCache Server. " + e.ToString(), EventLogEntryType.Error, EventCategories.Error, EventID.GeneralError); #endif } }