diff options
author | Teravus Ovares | 2009-01-03 03:30:03 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-01-03 03:30:03 +0000 |
commit | e9cef70f892bfbf4aad0e4471a958367766d849a (patch) | |
tree | 397e078977b430526a2f04041e0dfb9a5fb99156 /OpenSim/Region/UserStatistics/SimStatsAJAX.cs | |
parent | Split agent updates into two messages: full update and position+camera update... (diff) | |
download | opensim-SC-e9cef70f892bfbf4aad0e4471a958367766d849a.zip opensim-SC-e9cef70f892bfbf4aad0e4471a958367766d849a.tar.gz opensim-SC-e9cef70f892bfbf4aad0e4471a958367766d849a.tar.bz2 opensim-SC-e9cef70f892bfbf4aad0e4471a958367766d849a.tar.xz |
* Updates the sim stats module. Cleans out some of the rot.
* Adds a prototype web stats module which is disabled by default. It's functional with one report right now, however, the database structure may change, so I don't recommend enabling this to keep actual stats right now. I'll let you know when it's safe.
* Adds Prototype for ajaxy web content
* removed a warning or two.
Diffstat (limited to 'OpenSim/Region/UserStatistics/SimStatsAJAX.cs')
-rw-r--r-- | OpenSim/Region/UserStatistics/SimStatsAJAX.cs | 190 |
1 files changed, 190 insertions, 0 deletions
diff --git a/OpenSim/Region/UserStatistics/SimStatsAJAX.cs b/OpenSim/Region/UserStatistics/SimStatsAJAX.cs new file mode 100644 index 0000000..f6dd1d6 --- /dev/null +++ b/OpenSim/Region/UserStatistics/SimStatsAJAX.cs | |||
@@ -0,0 +1,190 @@ | |||
1 | using System; | ||
2 | using System.Collections; | ||
3 | using System.Collections.Generic; | ||
4 | using System.Reflection; | ||
5 | using System.Text; | ||
6 | using Mono.Data.SqliteClient; | ||
7 | using OpenMetaverse; | ||
8 | using OpenSim.Region.Environment.Scenes; | ||
9 | using OpenSim.Framework.Statistics; | ||
10 | |||
11 | namespace OpenSim.Region.UserStatistics | ||
12 | { | ||
13 | public class SimStatsAJAX : IStatsController | ||
14 | { | ||
15 | #region IStatsController Members | ||
16 | |||
17 | public Hashtable ProcessModel(Hashtable pParams) | ||
18 | { | ||
19 | List<Scene> m_scene = (List<Scene>)pParams["Scenes"]; | ||
20 | |||
21 | Hashtable nh = new Hashtable(); | ||
22 | nh.Add("hdata", m_scene); | ||
23 | nh.Add("simstats", pParams["SimStats"]); | ||
24 | |||
25 | return nh; | ||
26 | } | ||
27 | |||
28 | public string RenderView(Hashtable pModelResult) | ||
29 | { | ||
30 | StringBuilder output = new StringBuilder(); | ||
31 | List<Scene> all_scenes = (List<Scene>) pModelResult["hdata"]; | ||
32 | Dictionary<UUID, USimStatsData> sdatadic = (Dictionary<UUID,USimStatsData>)pModelResult["simstats"]; | ||
33 | |||
34 | const string TableClass = "defaultr"; | ||
35 | const string TRClass = "defaultr"; | ||
36 | const string TDHeaderClass = "header"; | ||
37 | const string TDDataClass = "content"; | ||
38 | //const string TDDataClassRight = "contentright"; | ||
39 | const string TDDataClassCenter = "contentcenter"; | ||
40 | |||
41 | foreach (USimStatsData sdata in sdatadic.Values) | ||
42 | { | ||
43 | |||
44 | |||
45 | foreach (Scene sn in all_scenes) | ||
46 | { | ||
47 | if (sn.RegionInfo.RegionID == sdata.RegionId) | ||
48 | { | ||
49 | output.Append("<H2>"); | ||
50 | output.Append(sn.RegionInfo.RegionName); | ||
51 | output.Append("</H2>"); | ||
52 | } | ||
53 | } | ||
54 | HTMLUtil.TABLE_O(ref output, TableClass); | ||
55 | HTMLUtil.TR_O(ref output, TRClass); | ||
56 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
57 | output.Append("Dilatn"); | ||
58 | HTMLUtil.TD_C(ref output); | ||
59 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
60 | output.Append("SimFPS"); | ||
61 | HTMLUtil.TD_C(ref output); | ||
62 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
63 | output.Append("PhysFPS"); | ||
64 | HTMLUtil.TD_C(ref output); | ||
65 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
66 | output.Append("AgntUp"); | ||
67 | HTMLUtil.TD_C(ref output); | ||
68 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
69 | output.Append("RootAg"); | ||
70 | HTMLUtil.TD_C(ref output); | ||
71 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
72 | output.Append("ChldAg"); | ||
73 | HTMLUtil.TD_C(ref output); | ||
74 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
75 | output.Append("Prims"); | ||
76 | HTMLUtil.TD_C(ref output); | ||
77 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
78 | output.Append("ATvPrm"); | ||
79 | HTMLUtil.TD_C(ref output); | ||
80 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
81 | output.Append("AtvScr"); | ||
82 | HTMLUtil.TD_C(ref output); | ||
83 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
84 | output.Append("ScrLPS"); | ||
85 | HTMLUtil.TD_C(ref output); | ||
86 | HTMLUtil.TR_C(ref output); | ||
87 | HTMLUtil.TR_O(ref output, TRClass); | ||
88 | HTMLUtil.TD_O(ref output, TDDataClass); | ||
89 | output.Append(sdata.TimeDilation); | ||
90 | HTMLUtil.TD_C(ref output); | ||
91 | HTMLUtil.TD_O(ref output, TDDataClass); | ||
92 | output.Append(sdata.SimFps); | ||
93 | HTMLUtil.TD_C(ref output); | ||
94 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
95 | output.Append(sdata.PhysicsFps); | ||
96 | HTMLUtil.TD_C(ref output); | ||
97 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
98 | output.Append(sdata.AgentUpdates); | ||
99 | HTMLUtil.TD_C(ref output); | ||
100 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
101 | output.Append(sdata.RootAgents); | ||
102 | HTMLUtil.TD_C(ref output); | ||
103 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
104 | output.Append(sdata.ChildAgents); | ||
105 | HTMLUtil.TD_C(ref output); | ||
106 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
107 | output.Append(sdata.TotalPrims); | ||
108 | HTMLUtil.TD_C(ref output); | ||
109 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
110 | output.Append(sdata.ActivePrims); | ||
111 | HTMLUtil.TD_C(ref output); | ||
112 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
113 | output.Append(sdata.ActiveScripts); | ||
114 | HTMLUtil.TD_C(ref output); | ||
115 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
116 | output.Append(sdata.ScriptLinesPerSecond); | ||
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, TDHeaderClass); | ||
121 | output.Append("FrmMS"); | ||
122 | HTMLUtil.TD_C(ref output); | ||
123 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
124 | output.Append("AgtMS"); | ||
125 | HTMLUtil.TD_C(ref output); | ||
126 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
127 | output.Append("PhysMS"); | ||
128 | HTMLUtil.TD_C(ref output); | ||
129 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
130 | output.Append("OthrMS"); | ||
131 | HTMLUtil.TD_C(ref output); | ||
132 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
133 | output.Append("ScrLPS"); | ||
134 | HTMLUtil.TD_C(ref output); | ||
135 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
136 | output.Append("OutPPS"); | ||
137 | HTMLUtil.TD_C(ref output); | ||
138 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
139 | output.Append("InPPS"); | ||
140 | HTMLUtil.TD_C(ref output); | ||
141 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
142 | output.Append("NoAckKB"); | ||
143 | HTMLUtil.TD_C(ref output); | ||
144 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
145 | output.Append("PndDWN"); | ||
146 | HTMLUtil.TD_C(ref output); | ||
147 | HTMLUtil.TD_O(ref output, TDHeaderClass); | ||
148 | output.Append("PndUP"); | ||
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, TDDataClass); | ||
153 | output.Append(sdata.TotalFrameTime); | ||
154 | HTMLUtil.TD_C(ref output); | ||
155 | HTMLUtil.TD_O(ref output, TDDataClass); | ||
156 | output.Append(sdata.AgentFrameTime); | ||
157 | HTMLUtil.TD_C(ref output); | ||
158 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
159 | output.Append(sdata.PhysicsFrameTime); | ||
160 | HTMLUtil.TD_C(ref output); | ||
161 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
162 | output.Append(sdata.OtherFrameTime); | ||
163 | HTMLUtil.TD_C(ref output); | ||
164 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
165 | output.Append(sdata.ScriptLinesPerSecond); | ||
166 | HTMLUtil.TD_C(ref output); | ||
167 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
168 | output.Append(sdata.OutPacketsPerSecond); | ||
169 | HTMLUtil.TD_C(ref output); | ||
170 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
171 | output.Append(sdata.InPacketsPerSecond); | ||
172 | HTMLUtil.TD_C(ref output); | ||
173 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
174 | output.Append(sdata.UnackedBytes); | ||
175 | HTMLUtil.TD_C(ref output); | ||
176 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
177 | output.Append(sdata.PendingDownloads); | ||
178 | HTMLUtil.TD_C(ref output); | ||
179 | HTMLUtil.TD_O(ref output, TDDataClassCenter); | ||
180 | output.Append(sdata.PendingUploads); | ||
181 | HTMLUtil.TD_C(ref output); | ||
182 | HTMLUtil.TR_C(ref output); | ||
183 | HTMLUtil.TABLE_C(ref output); | ||
184 | } | ||
185 | return output.ToString(); | ||
186 | } | ||
187 | |||
188 | #endregion | ||
189 | } | ||
190 | } | ||