aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/UserStatistics/SimStatsAJAX.cs
blob: f6dd1d6b034a3355ddc8ae241e81ed7a282099d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using Mono.Data.SqliteClient;
using OpenMetaverse;
using OpenSim.Region.Environment.Scenes;
using OpenSim.Framework.Statistics;

namespace OpenSim.Region.UserStatistics
{
    public class SimStatsAJAX : IStatsController
    {
        #region IStatsController Members

        public Hashtable ProcessModel(Hashtable pParams)
        {
            List<Scene> m_scene = (List<Scene>)pParams["Scenes"];
            
            Hashtable nh = new Hashtable();
            nh.Add("hdata", m_scene);
            nh.Add("simstats", pParams["SimStats"]);

            return nh;
        }

        public string RenderView(Hashtable pModelResult)
        {
            StringBuilder output = new StringBuilder();
            List<Scene> all_scenes = (List<Scene>) pModelResult["hdata"];
            Dictionary<UUID, USimStatsData> sdatadic = (Dictionary<UUID,USimStatsData>)pModelResult["simstats"];

            const string TableClass = "defaultr";
            const string TRClass = "defaultr";
            const string TDHeaderClass = "header";
            const string TDDataClass = "content";
            //const string TDDataClassRight = "contentright";
            const string TDDataClassCenter = "contentcenter";

            foreach (USimStatsData sdata in sdatadic.Values)
            {


                foreach (Scene sn in all_scenes)
                {
                    if (sn.RegionInfo.RegionID == sdata.RegionId)
                    {
                        output.Append("<H2>");
                        output.Append(sn.RegionInfo.RegionName);
                        output.Append("</H2>");
                    }
                }
                HTMLUtil.TABLE_O(ref output, TableClass);
                HTMLUtil.TR_O(ref output, TRClass);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("Dilatn");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("SimFPS");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("PhysFPS");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("AgntUp");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("RootAg");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("ChldAg");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("Prims");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("ATvPrm");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("AtvScr");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("ScrLPS");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TR_C(ref output);
                HTMLUtil.TR_O(ref output, TRClass);
                HTMLUtil.TD_O(ref output, TDDataClass);
                output.Append(sdata.TimeDilation);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClass);
                output.Append(sdata.SimFps);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.PhysicsFps);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.AgentUpdates);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.RootAgents);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.ChildAgents);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.TotalPrims);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.ActivePrims);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.ActiveScripts);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.ScriptLinesPerSecond);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TR_C(ref output);
                HTMLUtil.TR_O(ref output, TRClass);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("FrmMS");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("AgtMS");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("PhysMS");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("OthrMS");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("ScrLPS");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("OutPPS");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("InPPS");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("NoAckKB");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("PndDWN");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDHeaderClass);
                output.Append("PndUP");
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TR_C(ref output);
                HTMLUtil.TR_O(ref output, TRClass);
                HTMLUtil.TD_O(ref output, TDDataClass);
                output.Append(sdata.TotalFrameTime);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClass);
                output.Append(sdata.AgentFrameTime);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.PhysicsFrameTime);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.OtherFrameTime);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.ScriptLinesPerSecond);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.OutPacketsPerSecond);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.InPacketsPerSecond);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.UnackedBytes);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.PendingDownloads);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TD_O(ref output, TDDataClassCenter);
                output.Append(sdata.PendingUploads);
                HTMLUtil.TD_C(ref output);
                HTMLUtil.TR_C(ref output);
                HTMLUtil.TABLE_C(ref output);
            }
            return output.ToString();
        }

        #endregion
    }
}