show client stats: Fixed the requests/min. Also changed the spelling of the command, not without the dash.
parent
864a86983e
commit
bdaeb02863
|
@ -133,8 +133,8 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
|
||||||
HandleEmergencyMonitoring);
|
HandleEmergencyMonitoring);
|
||||||
|
|
||||||
scene.AddCommand(
|
scene.AddCommand(
|
||||||
"Comms", this, "show client-stats",
|
"Comms", this, "show client stats",
|
||||||
"show client-stats [first_name last_name]",
|
"show client stats [first_name last_name]",
|
||||||
"Show client request stats",
|
"Show client request stats",
|
||||||
"Without the 'first_name last_name' option, all clients are shown."
|
"Without the 'first_name last_name' option, all clients are shown."
|
||||||
+ " With the 'first_name last_name' option only a specific client is shown.",
|
+ " With the 'first_name last_name' option only a specific client is shown.",
|
||||||
|
@ -609,7 +609,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
|
||||||
// NOTE: This writes to m_log on purpose. We want to store this information
|
// NOTE: This writes to m_log on purpose. We want to store this information
|
||||||
// in case we need to analyze it later.
|
// in case we need to analyze it later.
|
||||||
//
|
//
|
||||||
if (showParams.Length <= 3)
|
if (showParams.Length <= 4)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[INFO]: {0,-12} {1,20} {2,6} {3,11} {4, 10}", "Region", "Name", "Root", "Time", "Reqs/min");
|
m_log.InfoFormat("[INFO]: {0,-12} {1,20} {2,6} {3,11} {4, 10}", "Region", "Name", "Root", "Time", "Reqs/min");
|
||||||
foreach (Scene scene in m_scenes.Values)
|
foreach (Scene scene in m_scenes.Values)
|
||||||
|
@ -621,7 +621,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
|
||||||
{
|
{
|
||||||
LLClientView llClient = client as LLClientView;
|
LLClientView llClient = client as LLClientView;
|
||||||
ClientInfo cinfo = llClient.UDPClient.GetClientInfo();
|
ClientInfo cinfo = llClient.UDPClient.GetClientInfo();
|
||||||
int avg_reqs = cinfo.AsyncRequests.Count + cinfo.GenericRequests.Count + cinfo.SyncRequests.Count;
|
int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum();
|
||||||
avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1);
|
avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1);
|
||||||
|
|
||||||
m_log.InfoFormat("[INFO]: {0,-12} {1,20} {2,4} {3,9}min {4,10}",
|
m_log.InfoFormat("[INFO]: {0,-12} {1,20} {2,4} {3,9}min {4,10}",
|
||||||
|
@ -635,10 +635,10 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
|
||||||
|
|
||||||
string fname = "", lname = "";
|
string fname = "", lname = "";
|
||||||
|
|
||||||
if (showParams.Length > 2)
|
|
||||||
fname = showParams[2];
|
|
||||||
if (showParams.Length > 3)
|
if (showParams.Length > 3)
|
||||||
lname = showParams[3];
|
fname = showParams[3];
|
||||||
|
if (showParams.Length > 4)
|
||||||
|
lname = showParams[4];
|
||||||
|
|
||||||
foreach (Scene scene in m_scenes.Values)
|
foreach (Scene scene in m_scenes.Values)
|
||||||
{
|
{
|
||||||
|
@ -660,7 +660,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
|
||||||
if (!llClient.SceneAgent.IsChildAgent)
|
if (!llClient.SceneAgent.IsChildAgent)
|
||||||
m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, aCircuit.Viewer, aCircuit.Id0);
|
m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, aCircuit.Viewer, aCircuit.Id0);
|
||||||
|
|
||||||
int avg_reqs = cinfo.AsyncRequests.Count + cinfo.GenericRequests.Count + cinfo.SyncRequests.Count;
|
int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum();
|
||||||
avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1);
|
avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1);
|
||||||
|
|
||||||
m_log.InfoFormat("[INFO]:");
|
m_log.InfoFormat("[INFO]:");
|
||||||
|
@ -669,29 +669,30 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
|
||||||
|
|
||||||
Dictionary<string, int> sortedDict = (from entry in cinfo.AsyncRequests orderby entry.Value descending select entry)
|
Dictionary<string, int> sortedDict = (from entry in cinfo.AsyncRequests orderby entry.Value descending select entry)
|
||||||
.ToDictionary(pair => pair.Key, pair => pair.Value);
|
.ToDictionary(pair => pair.Key, pair => pair.Value);
|
||||||
|
PrintRequests("TOP ASYNC", sortedDict, cinfo.AsyncRequests.Values.Sum());
|
||||||
|
|
||||||
m_log.InfoFormat("[INFO]: {0,25}", "TOP ASYNC");
|
|
||||||
foreach (KeyValuePair<string, int> kvp in sortedDict.Take(12))
|
|
||||||
m_log.InfoFormat("[INFO]: {0,25} {1,-6}", kvp.Key, kvp.Value);
|
|
||||||
|
|
||||||
m_log.InfoFormat("[INFO]:");
|
|
||||||
sortedDict = (from entry in cinfo.SyncRequests orderby entry.Value descending select entry)
|
sortedDict = (from entry in cinfo.SyncRequests orderby entry.Value descending select entry)
|
||||||
.ToDictionary(pair => pair.Key, pair => pair.Value);
|
.ToDictionary(pair => pair.Key, pair => pair.Value);
|
||||||
m_log.InfoFormat("[INFO]: {0,25}", "TOP SYNC");
|
PrintRequests("TOP SYNC", sortedDict, cinfo.SyncRequests.Values.Sum());
|
||||||
foreach (KeyValuePair<string, int> kvp in sortedDict.Take(12))
|
|
||||||
m_log.InfoFormat("[INFO]: {0,25} {1,-6}", kvp.Key, kvp.Value);
|
|
||||||
|
|
||||||
m_log.InfoFormat("[INFO]:");
|
|
||||||
sortedDict = (from entry in cinfo.GenericRequests orderby entry.Value descending select entry)
|
sortedDict = (from entry in cinfo.GenericRequests orderby entry.Value descending select entry)
|
||||||
.ToDictionary(pair => pair.Key, pair => pair.Value);
|
.ToDictionary(pair => pair.Key, pair => pair.Value);
|
||||||
m_log.InfoFormat("[INFO]: {0,25}", "TOP GENERIC");
|
PrintRequests("TOP GENERIC", sortedDict, cinfo.GenericRequests.Values.Sum());
|
||||||
foreach (KeyValuePair<string, int> kvp in sortedDict.Take(12))
|
|
||||||
m_log.InfoFormat("[INFO]: {0,25} {1,-6}", kvp.Key, kvp.Value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PrintRequests(string type, Dictionary<string, int> sortedDict, int sum)
|
||||||
|
{
|
||||||
|
m_log.InfoFormat("[INFO]:");
|
||||||
|
m_log.InfoFormat("[INFO]: {0,25}", type);
|
||||||
|
foreach (KeyValuePair<string, int> kvp in sortedDict.Take(12))
|
||||||
|
m_log.InfoFormat("[INFO]: {0,25} {1,-6}", kvp.Key, kvp.Value);
|
||||||
|
m_log.InfoFormat("[INFO]: {0,25}", "...");
|
||||||
|
m_log.InfoFormat("[INFO]: {0,25} {1,-6}", "Total", sum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue