diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Region/UserStatistics/SimStatsAJAX.cs | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/UserStatistics/SimStatsAJAX.cs (renamed from OpenSim/Region/UserStatistics/SimStatsAJAX.cs) | 65 |
1 files changed, 59 insertions, 6 deletions
diff --git a/OpenSim/Region/UserStatistics/SimStatsAJAX.cs b/OpenSim/Region/OptionalModules/UserStatistics/SimStatsAJAX.cs index 28051fb..06d9e91 100644 --- a/OpenSim/Region/UserStatistics/SimStatsAJAX.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/SimStatsAJAX.cs | |||
@@ -32,6 +32,7 @@ using System.Reflection; | |||
32 | using System.Text; | 32 | using System.Text; |
33 | using Mono.Data.SqliteClient; | 33 | using Mono.Data.SqliteClient; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenMetaverse.StructuredData; | ||
35 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
36 | using OpenSim.Framework.Monitoring; | 37 | using OpenSim.Framework.Monitoring; |
37 | 38 | ||
@@ -161,9 +162,6 @@ namespace OpenSim.Region.UserStatistics | |||
161 | output.Append("OthrMS"); | 162 | output.Append("OthrMS"); |
162 | HTMLUtil.TD_C(ref output); | 163 | HTMLUtil.TD_C(ref output); |
163 | HTMLUtil.TD_O(ref output, TDHeaderClass); | 164 | HTMLUtil.TD_O(ref output, TDHeaderClass); |
164 | output.Append("ScrLPS"); | ||
165 | HTMLUtil.TD_C(ref output); | ||
166 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
167 | output.Append("OutPPS"); | 165 | output.Append("OutPPS"); |
168 | HTMLUtil.TD_C(ref output); | 166 | HTMLUtil.TD_C(ref output); |
169 | HTMLUtil.TD_O(ref output, TDHeaderClass); | 167 | HTMLUtil.TD_O(ref output, TDHeaderClass); |
@@ -193,9 +191,6 @@ namespace OpenSim.Region.UserStatistics | |||
193 | output.Append(sdata.OtherFrameTime); | 191 | output.Append(sdata.OtherFrameTime); |
194 | HTMLUtil.TD_C(ref output); | 192 | HTMLUtil.TD_C(ref output); |
195 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | 193 | HTMLUtil.TD_O(ref output, TDDataClassCenter); |
196 | output.Append(sdata.ScriptLinesPerSecond); | ||
197 | HTMLUtil.TD_C(ref output); | ||
198 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
199 | output.Append(sdata.OutPacketsPerSecond); | 194 | output.Append(sdata.OutPacketsPerSecond); |
200 | HTMLUtil.TD_C(ref output); | 195 | HTMLUtil.TD_C(ref output); |
201 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | 196 | HTMLUtil.TD_O(ref output, TDDataClassCenter); |
@@ -218,6 +213,64 @@ namespace OpenSim.Region.UserStatistics | |||
218 | return output.ToString(); | 213 | return output.ToString(); |
219 | } | 214 | } |
220 | 215 | ||
216 | /// <summary> | ||
217 | /// Return stat information for all regions in the sim. Returns data of the form: | ||
218 | /// <pre> | ||
219 | /// {"REGIONNAME": { | ||
220 | /// "region": "REGIONNAME", | ||
221 | /// "timeDilation": "101", | ||
222 | /// ... // the rest of the stat info | ||
223 | /// }, | ||
224 | /// ... // entries for each region | ||
225 | /// } | ||
226 | /// </pre> | ||
227 | /// </summary> | ||
228 | /// <param name="pModelResult"></param> | ||
229 | /// <returns></returns> | ||
230 | public string RenderJson(Hashtable pModelResult) | ||
231 | { | ||
232 | List<Scene> all_scenes = (List<Scene>) pModelResult["hdata"]; | ||
233 | Dictionary<UUID, USimStatsData> sdatadic = (Dictionary<UUID,USimStatsData>)pModelResult["simstats"]; | ||
234 | |||
235 | OSDMap allStatsInfo = new OpenMetaverse.StructuredData.OSDMap(); | ||
236 | foreach (USimStatsData sdata in sdatadic.Values) | ||
237 | { | ||
238 | OSDMap statsInfo = new OpenMetaverse.StructuredData.OSDMap(); | ||
239 | string regionName = "unknown"; | ||
240 | foreach (Scene sn in all_scenes) | ||
241 | { | ||
242 | if (sn.RegionInfo.RegionID == sdata.RegionId) | ||
243 | { | ||
244 | regionName = sn.RegionInfo.RegionName; | ||
245 | break; | ||
246 | } | ||
247 | } | ||
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())); | ||
258 | statsInfo.Add("scriptLinesPerSec", new OSDString(sdata.ScriptLinesPerSecond.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())); | ||
263 | statsInfo.Add("outPacketsPerSec", new OSDString(sdata.OutPacketsPerSecond.ToString())); | ||
264 | statsInfo.Add("inPacketsPerSec", new OSDString(sdata.InPacketsPerSecond.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())); | ||
268 | |||
269 | allStatsInfo.Add(regionName, statsInfo); | ||
270 | } | ||
271 | return allStatsInfo.ToString(); | ||
272 | } | ||
273 | |||
221 | #endregion | 274 | #endregion |
222 | } | 275 | } |
223 | } | 276 | } |