29 using System.Collections;
30 using System.Collections.Generic;
31 using System.Reflection;
33 using Mono.Data.SqliteClient;
35 using OpenMetaverse.StructuredData;
36 using OpenSim.Region.Framework.Scenes;
37 using OpenSim.Framework.Monitoring;
39 namespace OpenSim.
Region.UserStatistics
43 #region IStatsController Members
45 public string ReportName
52 List<Scene> m_scene = (List<Scene>)pParams[
"Scenes"];
54 Hashtable nh =
new Hashtable();
55 nh.Add(
"hdata", m_scene);
56 nh.Add(
"simstats", pParams[
"SimStats"]);
62 StringBuilder output =
new StringBuilder();
63 List<Scene> all_scenes = (List<Scene>) pModelResult[
"hdata"];
64 Dictionary<UUID, USimStatsData> sdatadic = (Dictionary<UUID,USimStatsData>)pModelResult[
"simstats"];
66 const string TableClass =
"defaultr";
67 const string TRClass =
"defaultr";
68 const string TDHeaderClass =
"header";
69 const string TDDataClass =
"content";
71 const string TDDataClassCenter =
"contentcenter";
77 foreach (
Scene sn
in all_scenes)
81 output.Append(
"<H2>");
82 output.Append(sn.RegionInfo.RegionName);
83 output.Append(
"</H2>");
86 HTMLUtil.TABLE_O(ref output, TableClass);
87 HTMLUtil.TR_O(ref output, TRClass);
88 HTMLUtil.TD_O(ref output, TDHeaderClass);
89 output.Append(
"Dilatn");
90 HTMLUtil.TD_C(ref output);
91 HTMLUtil.TD_O(ref output, TDHeaderClass);
92 output.Append(
"SimFPS");
93 HTMLUtil.TD_C(ref output);
94 HTMLUtil.TD_O(ref output, TDHeaderClass);
95 output.Append(
"PhysFPS");
96 HTMLUtil.TD_C(ref output);
97 HTMLUtil.TD_O(ref output, TDHeaderClass);
98 output.Append(
"AgntUp");
99 HTMLUtil.TD_C(ref output);
100 HTMLUtil.TD_O(ref output, TDHeaderClass);
101 output.Append(
"RootAg");
102 HTMLUtil.TD_C(ref output);
103 HTMLUtil.TD_O(ref output, TDHeaderClass);
104 output.Append(
"ChldAg");
105 HTMLUtil.TD_C(ref output);
106 HTMLUtil.TD_O(ref output, TDHeaderClass);
107 output.Append(
"Prims");
108 HTMLUtil.TD_C(ref output);
109 HTMLUtil.TD_O(ref output, TDHeaderClass);
110 output.Append(
"ATvPrm");
111 HTMLUtil.TD_C(ref output);
112 HTMLUtil.TD_O(ref output, TDHeaderClass);
113 output.Append(
"AtvScr");
114 HTMLUtil.TD_C(ref output);
115 HTMLUtil.TD_O(ref output, TDHeaderClass);
116 output.Append(
"ScrLPS");
117 HTMLUtil.TD_C(ref output);
118 HTMLUtil.TR_C(ref output);
119 HTMLUtil.TR_O(ref output, TRClass);
120 HTMLUtil.TD_O(ref output, TDDataClass);
121 output.Append(sdata.TimeDilation);
122 HTMLUtil.TD_C(ref output);
123 HTMLUtil.TD_O(ref output, TDDataClass);
124 output.Append(sdata.SimFps);
125 HTMLUtil.TD_C(ref output);
126 HTMLUtil.TD_O(ref output, TDDataClassCenter);
127 output.Append(sdata.PhysicsFps);
128 HTMLUtil.TD_C(ref output);
129 HTMLUtil.TD_O(ref output, TDDataClassCenter);
130 output.Append(sdata.AgentUpdates);
131 HTMLUtil.TD_C(ref output);
132 HTMLUtil.TD_O(ref output, TDDataClassCenter);
133 output.Append(sdata.RootAgents);
134 HTMLUtil.TD_C(ref output);
135 HTMLUtil.TD_O(ref output, TDDataClassCenter);
136 output.Append(sdata.ChildAgents);
137 HTMLUtil.TD_C(ref output);
138 HTMLUtil.TD_O(ref output, TDDataClassCenter);
139 output.Append(sdata.TotalPrims);
140 HTMLUtil.TD_C(ref output);
141 HTMLUtil.TD_O(ref output, TDDataClassCenter);
142 output.Append(sdata.ActivePrims);
143 HTMLUtil.TD_C(ref output);
144 HTMLUtil.TD_O(ref output, TDDataClassCenter);
145 output.Append(sdata.ActiveScripts);
146 HTMLUtil.TD_C(ref output);
147 HTMLUtil.TD_O(ref output, TDDataClassCenter);
148 output.Append(sdata.ScriptLinesPerSecond);
149 HTMLUtil.TD_C(ref output);
150 HTMLUtil.TR_C(ref output);
151 HTMLUtil.TR_O(ref output, TRClass);
152 HTMLUtil.TD_O(ref output, TDHeaderClass);
153 output.Append(
"FrmMS");
154 HTMLUtil.TD_C(ref output);
155 HTMLUtil.TD_O(ref output, TDHeaderClass);
156 output.Append(
"AgtMS");
157 HTMLUtil.TD_C(ref output);
158 HTMLUtil.TD_O(ref output, TDHeaderClass);
159 output.Append(
"PhysMS");
160 HTMLUtil.TD_C(ref output);
161 HTMLUtil.TD_O(ref output, TDHeaderClass);
162 output.Append(
"OthrMS");
163 HTMLUtil.TD_C(ref output);
164 HTMLUtil.TD_O(ref output, TDHeaderClass);
165 output.Append(
"OutPPS");
166 HTMLUtil.TD_C(ref output);
167 HTMLUtil.TD_O(ref output, TDHeaderClass);
168 output.Append(
"InPPS");
169 HTMLUtil.TD_C(ref output);
170 HTMLUtil.TD_O(ref output, TDHeaderClass);
171 output.Append(
"NoAckKB");
172 HTMLUtil.TD_C(ref output);
173 HTMLUtil.TD_O(ref output, TDHeaderClass);
174 output.Append(
"PndDWN");
175 HTMLUtil.TD_C(ref output);
176 HTMLUtil.TD_O(ref output, TDHeaderClass);
177 output.Append(
"PndUP");
178 HTMLUtil.TD_C(ref output);
179 HTMLUtil.TR_C(ref output);
180 HTMLUtil.TR_O(ref output, TRClass);
181 HTMLUtil.TD_O(ref output, TDDataClass);
182 output.Append(sdata.TotalFrameTime);
183 HTMLUtil.TD_C(ref output);
184 HTMLUtil.TD_O(ref output, TDDataClass);
185 output.Append(sdata.AgentFrameTime);
186 HTMLUtil.TD_C(ref output);
187 HTMLUtil.TD_O(ref output, TDDataClassCenter);
188 output.Append(sdata.PhysicsFrameTime);
189 HTMLUtil.TD_C(ref output);
190 HTMLUtil.TD_O(ref output, TDDataClassCenter);
191 output.Append(sdata.OtherFrameTime);
192 HTMLUtil.TD_C(ref output);
193 HTMLUtil.TD_O(ref output, TDDataClassCenter);
194 output.Append(sdata.OutPacketsPerSecond);
195 HTMLUtil.TD_C(ref output);
196 HTMLUtil.TD_O(ref output, TDDataClassCenter);
197 output.Append(sdata.InPacketsPerSecond);
198 HTMLUtil.TD_C(ref output);
199 HTMLUtil.TD_O(ref output, TDDataClassCenter);
200 output.Append(sdata.UnackedBytes);
201 HTMLUtil.TD_C(ref output);
202 HTMLUtil.TD_O(ref output, TDDataClassCenter);
203 output.Append(sdata.PendingDownloads);
204 HTMLUtil.TD_C(ref output);
205 HTMLUtil.TD_O(ref output, TDDataClassCenter);
206 output.Append(sdata.PendingUploads);
207 HTMLUtil.TD_C(ref output);
208 HTMLUtil.TR_C(ref output);
209 HTMLUtil.TABLE_C(ref output);
213 return output.ToString();
232 List<Scene> all_scenes = (List<Scene>) pModelResult[
"hdata"];
233 Dictionary<UUID, USimStatsData> sdatadic = (Dictionary<UUID,USimStatsData>)pModelResult[
"simstats"];
235 OSDMap allStatsInfo =
new OpenMetaverse.StructuredData.OSDMap();
238 OSDMap statsInfo =
new OpenMetaverse.StructuredData.OSDMap();
239 string regionName =
"unknown";
240 foreach (
Scene sn
in all_scenes)
244 regionName = sn.RegionInfo.RegionName;
248 statsInfo.Add(
"region",
new OSDString(regionName));
249 statsInfo.Add(
"timeDilation",
new OSDString(sdata.
TimeDilation.ToString()));
250 statsInfo.Add(
"simFPS",
new OSDString(sdata.
SimFps.ToString()));
251 statsInfo.Add(
"physicsFPS",
new OSDString(sdata.
PhysicsFps.ToString()));
252 statsInfo.Add(
"agentUpdates",
new OSDString(sdata.
AgentUpdates.ToString()));
253 statsInfo.Add(
"rootAgents",
new OSDString(sdata.
RootAgents.ToString()));
254 statsInfo.Add(
"childAgents",
new OSDString(sdata.
ChildAgents.ToString()));
255 statsInfo.Add(
"totalPrims",
new OSDString(sdata.
TotalPrims.ToString()));
256 statsInfo.Add(
"activePrims",
new OSDString(sdata.
ActivePrims.ToString()));
257 statsInfo.Add(
"activeScripts",
new OSDString(sdata.
ActiveScripts.ToString()));
259 statsInfo.Add(
"totalFrameTime",
new OSDString(sdata.
TotalFrameTime.ToString()));
260 statsInfo.Add(
"agentFrameTime",
new OSDString(sdata.
AgentFrameTime.ToString()));
261 statsInfo.Add(
"physicsFrameTime",
new OSDString(sdata.
PhysicsFrameTime.ToString()));
262 statsInfo.Add(
"otherFrameTime",
new OSDString(sdata.
OtherFrameTime.ToString()));
265 statsInfo.Add(
"unackedByptes",
new OSDString(sdata.
UnackedBytes.ToString()));
266 statsInfo.Add(
"pendingDownloads",
new OSDString(sdata.
PendingDownloads.ToString()));
267 statsInfo.Add(
"pendingUploads",
new OSDString(sdata.
PendingUploads.ToString()));
269 allStatsInfo.Add(regionName, statsInfo);
271 return allStatsInfo.ToString();
float OutPacketsPerSecond
Hashtable ProcessModel(Hashtable pParams)
OpenMetaverse.StructuredData.OSDMap OSDMap
string RenderView(Hashtable pModelResult)
float ScriptLinesPerSecond
virtual RegionInfo RegionInfo
string RenderJson(Hashtable pModelResult)
Return stat information for all regions in the sim. Returns data of the form: