diff options
author | Justin Clark-Casey (justincc) | 2012-11-15 02:02:59 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-11-15 02:02:59 +0000 |
commit | 038528dc80e0fe03956d61872ba30a887b2890a1 (patch) | |
tree | e6a63a208aa4fcf15ae13417801ee44ca7c9dd71 /OpenSim/Framework/Monitoring/StatsManager.cs | |
parent | Add IncomingPacketsProcessedCount stat for diagnostics. (diff) | |
download | opensim-SC-038528dc80e0fe03956d61872ba30a887b2890a1.zip opensim-SC-038528dc80e0fe03956d61872ba30a887b2890a1.tar.gz opensim-SC-038528dc80e0fe03956d61872ba30a887b2890a1.tar.bz2 opensim-SC-038528dc80e0fe03956d61872ba30a887b2890a1.tar.xz |
Make PacketPool class stats pull stats instead of push stats so they can be lifted up into LLUDPServer and be distiguished by scene name
Diffstat (limited to 'OpenSim/Framework/Monitoring/StatsManager.cs')
-rw-r--r-- | OpenSim/Framework/Monitoring/StatsManager.cs | 14 |
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 | ||