コード例 #1
0
        /// <summary>
        /// Schedules a rule to be run over different stamps and environments.
        /// </summary>
        private void OncePerStamp(Func <SingleStampRuleArguments, IEnumerable <Instantiation> > generator, Watchlist watchlist)
        {
            foreach (var(stampId, properties) in watchlist.Entries)
            {
                var environmentConfiguration = _configuration.Environments[stampId.Environment];
                var resources = _environmentResources[stampId.Environment];

                var configuration = new SingleStampRuleConfiguration(
                    _clock,
                    _logger,
                    _alertNotifier,
                    resources.KustoQueryClient,
                    _icmClient,
                    environmentConfiguration.KustoDatabaseName,
                    properties.CacheTableName,
                    stampId);

                var request = new SingleStampRuleArguments
                {
                    StampId = stampId,
                    DynamicStampProperties = properties,
                    BaseConfiguration      = configuration,
                    EnvironmentResources   = resources,
                };

                foreach (var rule in generator(request))
                {
                    Contract.AssertNotNull(rule.Rule);
                    _scheduler.Add(rule.Rule, rule.PollingPeriod, rule.ForceRun);
                }
            }
        }
コード例 #2
0
 public Configuration(SingleStampRuleConfiguration kustoRuleConfiguration)
     : base(kustoRuleConfiguration)
 {
 }
コード例 #3
0
 public SingleStampRuleBase(SingleStampRuleConfiguration configuration)
     : base(configuration)
 {
     _configuration = configuration;
 }