GetMillisDuration() private method

private GetMillisDuration ( string path, System.TimeSpan @default = null, bool allowInfinite = true ) : System.TimeSpan
path string
@default System.TimeSpan
allowInfinite bool
return System.TimeSpan
Esempio n. 1
0
 public RemoteSettings(Config config)
 {
     Config = config;
     LogReceive = config.GetBoolean("akka.remote.log-received-messages");
     LogSend = config.GetBoolean("akka.remote.log-sent-messages");
     UntrustedMode = config.GetBoolean("akka.remote.untrusted-mode");
     TrustedSelectionPaths = new HashSet<string>(config.GetStringList("akka.remote.trusted-selection-paths"));
     RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events") ?? "DEBUG";
     if (RemoteLifecycleEventsLogLevel.Equals("on")) RemoteLifecycleEventsLogLevel = "DEBUG";
     FlushWait = config.GetMillisDuration("akka.remote.flush-wait-on-shutdown");
     ShutdownTimeout = config.GetMillisDuration("akka.remote.shutdown-timeout");
     TransportNames = config.GetStringList("akka.remote.enabled-transports");
     Transports = (from transportName in TransportNames
         let transportConfig = TransportConfigFor(transportName)
         select new TransportSettings(transportConfig)).ToArray();
     Adapters = ConfigToMap(config.GetConfig("akka.remote.adapters"));
     BackoffPeriod = config.GetMillisDuration("akka.remote.backoff-interval");
     RetryGateClosedFor = config.GetMillisDuration("akka.remote.retry-gate-closed-for", TimeSpan.Zero);
     UsePassiveConnections = config.GetBoolean("akka.remote.use-passive-connections");
     SysMsgBufferSize = config.GetInt("akka.remote.system-message-buffer-size");
     SysResendTimeout = config.GetMillisDuration("akka.remote.resend-interval");
     InitialSysMsgDeliveryTimeout = config.GetMillisDuration("akka.remote.initial-system-message-delivery-timeout");
     SysMsgAckTimeout = config.GetMillisDuration("akka.remote.system-message-ack-piggyback-timeout");
     QuarantineDuration = config.GetMillisDuration("akka.remote.prune-quarantine-marker-after");
     StartupTimeout = config.GetMillisDuration("akka.remote.startup-timeout");
     CommandAckTimeout = config.GetMillisDuration("akka.remote.command-ack-timeout");
 }
Esempio n. 2
0
 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.GetMillisDuration("min-std-deviation");
     _acceptableHeartbeatPause = config.GetMillisDuration("acceptable-heartbeat-pause");
     _firstHeartbeatEstimate = config.GetMillisDuration("heartbeat-interval");
     state = new State(FirstHeartBeat, null);
 }
Esempio n. 4
0
        public RemoteSettings(Config config)
        {
            Config = config;
            LogReceive = config.GetBoolean("akka.remote.log-received-messages");
            LogSend = config.GetBoolean("akka.remote.log-sent-messages");

            var bufferSizeLogKey = "akka.remote.log-buffer-size-exceeding";
            if (config.GetString(bufferSizeLogKey).ToLowerInvariant().Equals("off") ||
                config.GetString(bufferSizeLogKey).ToLowerInvariant().Equals("false"))
            {
                LogBufferSizeExceeding = Int32.MaxValue;
            }
            else
            {
                LogBufferSizeExceeding = config.GetInt(bufferSizeLogKey);
            }

            UntrustedMode = config.GetBoolean("akka.remote.untrusted-mode");
            TrustedSelectionPaths = new HashSet<string>(config.GetStringList("akka.remote.trusted-selection-paths"));
            RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events") ?? "DEBUG";
            Dispatcher = config.GetString("akka.remote.use-dispatcher");
            if (RemoteLifecycleEventsLogLevel.Equals("on")) RemoteLifecycleEventsLogLevel = "DEBUG";
            FlushWait = config.GetMillisDuration("akka.remote.flush-wait-on-shutdown");
            ShutdownTimeout = config.GetMillisDuration("akka.remote.shutdown-timeout");
            TransportNames = config.GetStringList("akka.remote.enabled-transports");
            Transports = (from transportName in TransportNames
                let transportConfig = TransportConfigFor(transportName)
                select new TransportSettings(transportConfig)).ToArray();
            Adapters = ConfigToMap(config.GetConfig("akka.remote.adapters"));
            BackoffPeriod = config.GetMillisDuration("akka.remote.backoff-interval");
            RetryGateClosedFor = config.GetMillisDuration("akka.remote.retry-gate-closed-for", TimeSpan.Zero);
            UsePassiveConnections = config.GetBoolean("akka.remote.use-passive-connections");
            SysMsgBufferSize = config.GetInt("akka.remote.system-message-buffer-size");
            SysResendTimeout = config.GetMillisDuration("akka.remote.resend-interval");
            InitialSysMsgDeliveryTimeout = config.GetMillisDuration("akka.remote.initial-system-message-delivery-timeout");
            SysMsgAckTimeout = config.GetMillisDuration("akka.remote.system-message-ack-piggyback-timeout");
            QuarantineDuration = config.GetMillisDuration("akka.remote.prune-quarantine-marker-after");
            StartupTimeout = config.GetMillisDuration("akka.remote.startup-timeout");
            CommandAckTimeout = config.GetMillisDuration("akka.remote.command-ack-timeout");

            WatchFailureDetectorConfig = config.GetConfig("akka.remote.watch-failure-detector");
            WatchFailureDetectorImplementationClass = WatchFailureDetectorConfig.GetString("implementation-class");
            WatchHeartBeatInterval = WatchFailureDetectorConfig.GetMillisDuration("heartbeat-interval");
            WatchUnreachableReaperInterval = WatchFailureDetectorConfig.GetMillisDuration("unreachable-nodes-reaper-interval");
            WatchHeartbeatExpectedResponseAfter = WatchFailureDetectorConfig.GetMillisDuration("expected-response-after");
        }
Esempio n. 5
0
 public RemoteSettings(Config config)
 {
     Config = config;
     LogReceive = config.GetBoolean("akka.remote.log-received-messages");
     LogSend = config.GetBoolean("akka.remote.log-sent-messages");
     UntrustedMode = config.GetBoolean("akka.remote.untrusted-mode");
     TrustedSelectionPaths = new HashSet<string>(config.GetStringList("akka.remote.trusted-selection-paths"));
     RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events");
     ShutdownTimeout = config.GetMillisDuration("akka.remote.shutdown-timeout");
     TransportNames = config.GetStringList("akka.remote.enabled-transports");
     Transports = (from transportName in TransportNames
         let transportConfig = TransportConfigFor(transportName)
         select new TransportSettings(transportConfig)).ToArray();
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="ScatterGatherFirstCompletedGroup" /> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 public ScatterGatherFirstCompletedGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
     _within = config.GetMillisDuration("within");
 }
 public ScatterGatherFirstCompletedPool(Config config) : base(config)
 {
     _within = config.GetMillisDuration("within");
 }
 /// <summary>
 /// Creates an instance of the TailChoppingGroup.
 /// </summary>
 /// <param name="config">The configuration to use with this instance.</param>
 public TailChoppingGroup(Config config)
 {
     Paths = config.GetStringList("routees.paths").ToArray();
     within = config.GetMillisDuration("within");
     interval = config.GetMillisDuration("tail-chopping-router.interval");
 }
 /// <summary>
 /// Creates an instance of the TailChoppingPool.
 /// </summary>
 /// <param name="config">The configuration to use with this instance.</param>
 public TailChoppingPool(Config config)
 {
     NrOfInstances = config.GetInt("nr-of-instances");
     within = config.GetMillisDuration("within");
     interval = config.GetMillisDuration("tail-chopping-router.interval");
     Resizer = DefaultResizer.FromConfig(config);
     UsePoolDispatcher = config.HasPath("pool-dispatcher");
 }
 /// <summary>
 /// Constructor that reads parameters from an Akka <see cref="Config"/> section.
 /// Expects property 'acceptable-heartbeat-pause'.
 /// </summary>
 /// <param name="config"></param>
 /// <param name="ev"></param>
 public DeadlineFailureDetector(Config config, EventStream ev) : this(config.GetMillisDuration("acceptable-heartbeat-pause")) { }