aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Monitoring
diff options
context:
space:
mode:
authorMelanie2012-11-15 03:46:10 +0000
committerMelanie2012-11-15 03:46:10 +0000
commit5895c4cc6f698bcb415b08a96322f06fb44413ca (patch)
tree5b223f297b27ac3966c65526f422fc82095b9b86 /OpenSim/Framework/Monitoring
parentMerge branch 'master' into careminster (diff)
parentImprove inventory folder version updating for mssql database plugin. (diff)
downloadopensim-SC_OLD-5895c4cc6f698bcb415b08a96322f06fb44413ca.zip
opensim-SC_OLD-5895c4cc6f698bcb415b08a96322f06fb44413ca.tar.gz
opensim-SC_OLD-5895c4cc6f698bcb415b08a96322f06fb44413ca.tar.bz2
opensim-SC_OLD-5895c4cc6f698bcb415b08a96322f06fb44413ca.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
Diffstat (limited to 'OpenSim/Framework/Monitoring')
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs14
1 files changed, 10 insertions, 4 deletions
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index 4844336..cebe905 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -382,14 +382,20 @@ namespace OpenSim.Framework.Monitoring
382 382
383 public class PercentageStat : Stat 383 public class PercentageStat : Stat
384 { 384 {
385 public int Antecedent { get; set; } 385 public long Antecedent { get; set; }
386 public int Consequent { get; set; } 386 public long Consequent { get; set; }
387 387
388 public override double Value 388 public override double Value
389 { 389 {
390 get 390 get
391 { 391 {
392 int c = Consequent; 392 // Asking for an update here means that the updater cannot access this value without infinite recursion.
393 // XXX: A slightly messy but simple solution may be to flick a flag so we can tell if this is being
394 // called by the pull action and just return the value.
395 if (StatType == StatType.Pull)
396 PullAction(this);
397
398 long c = Consequent;
393 399
394 // Avoid any chance of a multi-threaded divide-by-zero 400 // Avoid any chance of a multi-threaded divide-by-zero
395 if (c == 0) 401 if (c == 0)
@@ -400,7 +406,7 @@ namespace OpenSim.Framework.Monitoring
400 406
401 set 407 set
402 { 408 {
403 throw new Exception("Cannot set value on a PercentageStat"); 409 throw new InvalidOperationException("Cannot set value on a PercentageStat");
404 } 410 }
405 } 411 }
406 412