diff options
author | Melanie Thielker | 2015-02-18 01:14:08 +0100 |
---|---|---|
committer | Melanie Thielker | 2015-02-18 01:14:08 +0100 |
commit | fed566b8d3bb480ec89615e011934c10023a4dad (patch) | |
tree | 13c497f738651fe766ae115c92ee3a06fe5efe24 /OpenSim/Framework/Monitoring/Stats | |
parent | fix axis locking Amotor (diff) | |
download | opensim-SC-fed566b8d3bb480ec89615e011934c10023a4dad.zip opensim-SC-fed566b8d3bb480ec89615e011934c10023a4dad.tar.gz opensim-SC-fed566b8d3bb480ec89615e011934c10023a4dad.tar.bz2 opensim-SC-fed566b8d3bb480ec89615e011934c10023a4dad.tar.xz |
Abbreviate the stats by removing unneeded and redundant elements. Human readability is overrated. Also add a (hardcoded) password.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Monitoring/Stats/Stat.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/StatsManager.cs | 15 |
2 files changed, 25 insertions, 3 deletions
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index e095801..bd757d0 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs | |||
@@ -238,6 +238,17 @@ namespace OpenSim.Framework.Monitoring | |||
238 | return sb.ToString(); | 238 | return sb.ToString(); |
239 | } | 239 | } |
240 | 240 | ||
241 | public virtual OSDMap ToBriefOSDMap() | ||
242 | { | ||
243 | OSDMap ret = new OSDMap(); | ||
244 | |||
245 | ret.Add("Value", OSD.FromReal(Value)); | ||
246 | |||
247 | double lastChangeOverTime, averageChangeOverTime; | ||
248 | |||
249 | return ret; | ||
250 | } | ||
251 | |||
241 | public virtual OSDMap ToOSDMap() | 252 | public virtual OSDMap ToOSDMap() |
242 | { | 253 | { |
243 | OSDMap ret = new OSDMap(); | 254 | OSDMap ret = new OSDMap(); |
@@ -322,4 +333,4 @@ namespace OpenSim.Framework.Monitoring | |||
322 | } | 333 | } |
323 | } | 334 | } |
324 | } | 335 | } |
325 | } \ No newline at end of file | 336 | } |
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs index 05ee4c5..249cef6 100644 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs | |||
@@ -253,7 +253,7 @@ namespace OpenSim.Framework.Monitoring | |||
253 | if (!(String.IsNullOrEmpty(pStatName) || pStatName == AllSubCommand || pStatName == statName)) | 253 | if (!(String.IsNullOrEmpty(pStatName) || pStatName == AllSubCommand || pStatName == statName)) |
254 | continue; | 254 | continue; |
255 | 255 | ||
256 | statMap.Add(statName, theStats[statName].ToOSDMap()); | 256 | statMap.Add(statName, theStats[statName].ToBriefOSDMap()); |
257 | } | 257 | } |
258 | 258 | ||
259 | contMap.Add(contName, statMap); | 259 | contMap.Add(contName, statMap); |
@@ -275,6 +275,17 @@ namespace OpenSim.Framework.Monitoring | |||
275 | string pContainerName = StatsManager.AllSubCommand; | 275 | string pContainerName = StatsManager.AllSubCommand; |
276 | string pStatName = StatsManager.AllSubCommand; | 276 | string pStatName = StatsManager.AllSubCommand; |
277 | 277 | ||
278 | if (!request.ContainsKey("pass") || request["pass"].ToString() != "l0st4nge1s") | ||
279 | { | ||
280 | responsedata["int_response_code"] = response_code; | ||
281 | responsedata["content_type"] = "text/plain"; | ||
282 | responsedata["keepalive"] = false; | ||
283 | responsedata["str_response_string"] = "Access denied"; | ||
284 | responsedata["access_control_allow_origin"] = "*"; | ||
285 | |||
286 | return responsedata; | ||
287 | } | ||
288 | |||
278 | if (request.ContainsKey("cat")) pCategoryName = request["cat"].ToString(); | 289 | if (request.ContainsKey("cat")) pCategoryName = request["cat"].ToString(); |
279 | if (request.ContainsKey("cont")) pContainerName = request["cat"].ToString(); | 290 | if (request.ContainsKey("cont")) pContainerName = request["cat"].ToString(); |
280 | if (request.ContainsKey("stat")) pStatName = request["cat"].ToString(); | 291 | if (request.ContainsKey("stat")) pStatName = request["cat"].ToString(); |
@@ -524,4 +535,4 @@ namespace OpenSim.Framework.Monitoring | |||
524 | Debug, | 535 | Debug, |
525 | Info | 536 | Info |
526 | } | 537 | } |
527 | } \ No newline at end of file | 538 | } |