* minor: refactor thread report into a method that returns a string rather than displays information directly
							parent
							
								
									3a8320c7a1
								
							
						
					
					
						commit
						4a475ca2be
					
				| 
						 | 
				
			
			@ -111,6 +111,32 @@ namespace OpenSim.Framework.Servers
 | 
			
		|||
            m_log.Debug(sb);
 | 
			
		||||
        }
 | 
			
		||||
                
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// Get a report about the registered threads in this server.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        protected string GetThreadReport()
 | 
			
		||||
        {
 | 
			
		||||
            StringBuilder sb = new StringBuilder();
 | 
			
		||||
            
 | 
			
		||||
            List<Thread> threads = ThreadTracker.GetThreads();
 | 
			
		||||
            if (threads == null)
 | 
			
		||||
            {
 | 
			
		||||
                sb.Append("Thread tracking is only enabled in DEBUG mode.");
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                sb.Append(threads.Count + " threads are being tracked:" + Environment.NewLine);
 | 
			
		||||
                foreach (Thread t in threads)
 | 
			
		||||
                {
 | 
			
		||||
                    sb.Append(
 | 
			
		||||
                        "ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", Alive: " + t.IsAlive 
 | 
			
		||||
                        + ", Pri: " + t.Priority + ", State: " + t.ThreadState + Environment.NewLine);
 | 
			
		||||
                }
 | 
			
		||||
            }   
 | 
			
		||||
            
 | 
			
		||||
            return sb.ToString();
 | 
			
		||||
        }        
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// Return a report about the uptime of this server
 | 
			
		||||
        /// </summary>
 | 
			
		||||
| 
						 | 
				
			
			@ -261,7 +287,7 @@ namespace OpenSim.Framework.Servers
 | 
			
		|||
        /// Show help information
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="helpArgs"></param>
 | 
			
		||||
        public virtual void ShowHelp(string[] helpArgs)
 | 
			
		||||
        protected virtual void ShowHelp(string[] helpArgs)
 | 
			
		||||
        {
 | 
			
		||||
            if (helpArgs.Length == 0)
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -308,19 +334,7 @@ namespace OpenSim.Framework.Servers
 | 
			
		|||
                    break;
 | 
			
		||||
 | 
			
		||||
                case "threads":
 | 
			
		||||
                    List<Thread> threads = ThreadTracker.GetThreads();
 | 
			
		||||
                    if (threads == null)
 | 
			
		||||
                    {
 | 
			
		||||
                        Notice("Thread tracking is only enabled in DEBUG mode.");
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        Notice(threads.Count + " threads are being tracked:");
 | 
			
		||||
                        foreach (Thread t in threads)
 | 
			
		||||
                        {
 | 
			
		||||
                            Notice("ID: " + t.ManagedThreadId.ToString() + ", Name: " + t.Name + ", Alive: " + t.IsAlive.ToString() + ", Pri: " + t.Priority.ToString() + ", State: " + t.ThreadState.ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    Notice(GetThreadReport());
 | 
			
		||||
                    break;
 | 
			
		||||
 | 
			
		||||
                case "uptime":
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -248,7 +248,6 @@ namespace OpenSim.Grid.UserServer
 | 
			
		|||
                    break;
 | 
			
		||||
 | 
			
		||||
                case "logoff-user":
 | 
			
		||||
 | 
			
		||||
                    if (cmdparams.Length >= 3)
 | 
			
		||||
                    {
 | 
			
		||||
                        string firstname = cmdparams[0];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -602,7 +602,7 @@ namespace OpenSim
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void ShowHelp(string[] helpArgs)
 | 
			
		||||
        protected override void ShowHelp(string[] helpArgs)
 | 
			
		||||
        {
 | 
			
		||||
            base.ShowHelp(helpArgs);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,7 +58,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 | 
			
		|||
 | 
			
		||||
        //                ~ClientView()
 | 
			
		||||
        //                {
 | 
			
		||||
        //                    m_log.Info("[CLIENTVIEW]: Destructor called");
 | 
			
		||||
        //                    m_log.Info("[CLIENT]: LLClientView destructor called");
 | 
			
		||||
        //                }
 | 
			
		||||
 | 
			
		||||
        /* static variables */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue