public GetDouble ( string path, double @default ) : double | ||
path | string | The path that contains the value to retrieve. |
@default | double | |
return | double |
public TestKitSettings(Config config) { _defaultTimeout = config.GetMillisDuration("akka.test.default-timeout", allowInfinite:false); _singleExpectDefault = config.GetMillisDuration("akka.test.single-expect-default", allowInfinite: false); _testEventFilterLeeway = config.GetMillisDuration("akka.test.filter-leeway", allowInfinite: false); _timefactor = config.GetDouble("akka.test.timefactor"); if(_timefactor <= 0) throw new Exception(@"Expected a positive value for ""akka.test.timefactor"" but found "+_timefactor); }
/// <summary> /// Constructor that reads parameters from config. /// Expecting config properties named 'threshold', 'max-sample-size', /// 'min-std-deviation', 'acceptable-heartbeat-pause', and 'heartbeat-interval'. /// </summary> public PhiAccrualFailureDetector(Config config, EventStream ev) : this(DefaultClock) { _threshold = config.GetDouble("threshold"); _maxSampleSize = config.GetInt("max-sample-size"); _minStdDeviation = config.GetTimeSpan("min-std-deviation"); _acceptableHeartbeatPause = config.GetTimeSpan("acceptable-heartbeat-pause"); _firstHeartbeatEstimate = config.GetTimeSpan("heartbeat-interval"); state = new State(FirstHeartBeat, null); }
private int ComputeWps(Config config) { return ThreadPoolConfig.ScaledPoolSize(config.GetInt("pool-size-min"), config.GetDouble("pool-size-factor"), config.GetInt("pool-size-max")); }
public ChaosDestination(ActorRef probe) { Probe = probe; State = new List<int>(); _config = Context.System.Settings.Config.GetConfig("akka.persistence.destination.chaos"); _confirmFailureRate = _config.GetDouble("confirm-failure-rate"); Receive<Msg>(m => { if (ChaosSupportExtensions.ShouldFail(_confirmFailureRate)) { Log.Error(string.Format("[destination] confirm message failed (message = {0}, {1})", m.DeliveryId, m.I)); } else if (State.Contains(m.I)) { Log.Debug(string.Format("[destination] ignored duplicate (message = {0}, {1})", m.DeliveryId, m.I)); Sender.Tell(new Confirm(m.DeliveryId, m.I)); } else { this.Add(m.I); Sender.Tell(new Confirm(m.DeliveryId, m.I)); Log.Debug(string.Format("[destination] received and confirmed (message = {0}, {1})", m.DeliveryId, m.I)); } }); }
public ChaosSender(ActorRef destination, ActorRef probe) { _destination = destination; Probe = probe; State = new List<int>(); _persistenceId = "chaosSender"; _config = Context.System.Settings.Config.GetConfig("akka.persistence.sender.chaos"); _liveProcessingFailureRate = _config.GetDouble("live-processing-failure-rate"); _replayProcessingFailureRate = _config.GetDouble("replay-processing-failure-rate"); }
/// <summary> /// Creates a new DefaultResizer from the given configuration /// </summary> /// <param name="resizerConfig"></param> private DefaultResizer(Config resizerConfig) { LowerBound = resizerConfig.GetInt("lower-bound"); UpperBound = resizerConfig.GetInt("upper-bound"); _pressureThreshold = resizerConfig.GetInt("pressure-threshold"); _rampupRate = resizerConfig.GetDouble("rampup-rate"); _backoffThreshold = resizerConfig.GetDouble("backoff-threshold"); _backoffRate = resizerConfig.GetDouble("backoff-rate"); _messagesPerResize = resizerConfig.GetInt("messages-per-resize"); Validate(); }