Beispiel #1
0
        private void SetupServerStatusMetadata()
        {
            if (m_ServerStatusMetadataSource == null)
            {
                m_ServerStatusMetadataSource = new List <KeyValuePair <string, StatusInfoAttribute[]> >(m_AppServers.Length + 1);

                m_ServerStatusMetadataSource.Add(
                    new KeyValuePair <string, StatusInfoAttribute[]>(string.Empty,
                                                                     new StatusInfoAttribute[]
                {
                    new StatusInfoAttribute(StatusInfoKeys.CpuUsage)
                    {
                        Name = "CPU Usage", Format = "{0:0.00}%", Order = 0
                    },
                    new StatusInfoAttribute(StatusInfoKeys.MemoryUsage)
                    {
                        Name = "Physical Memory Usage", Format = "{0:N}", Order = 1
                    },
                    new StatusInfoAttribute(StatusInfoKeys.TotalThreadCount)
                    {
                        Name = "Total Thread Count", Order = 2
                    },
                    new StatusInfoAttribute(StatusInfoKeys.AvailableWorkingThreads)
                    {
                        Name = "Available Working Threads", Order = 3
                    },
                    new StatusInfoAttribute(StatusInfoKeys.AvailableCompletionPortThreads)
                    {
                        Name = "Available Completion Port Threads", Order = 4
                    },
                    new StatusInfoAttribute(StatusInfoKeys.MaxWorkingThreads)
                    {
                        Name = "Maximum Working Threads", Order = 5
                    },
                    new StatusInfoAttribute(StatusInfoKeys.MaxCompletionPortThreads)
                    {
                        Name = "Maximum Completion Port Threads", Order = 6
                    }
                }));

                for (var i = 0; i < m_AppServers.Length; i++)
                {
                    var server = m_AppServers[i];
                    m_ServerStatusMetadataSource.Add(
                        new KeyValuePair <string, StatusInfoAttribute[]>(server.Name,
                                                                         server.GetAppServerMetadata().StatusFields.OrderBy(s => s.Order).ToArray()));
                }

                if (m_ServerManager != null && m_ServerManager.State == ServerState.Running)
                {
                    m_ServerManager.TransferSystemMessage("ServerMetadataCollected", m_ServerStatusMetadataSource);
                }
            }
        }
Beispiel #2
0
 public void TransferSystemMessage(string messageType, object messageData)
 {
     m_AppServer.TransferSystemMessage(messageType, messageData);
 }