Esempio n. 1
0
 public SQLModule(IOptions <SQLSettings> settings) : base(settings)
 {
     StandaloneInstances = settings.Value.Instances
                           .Select(i => new SQLInstance(this, i))
                           .Where(i => i.TryAddToGlobalPollers())
                           .ToList();
     Clusters     = settings.Value.Clusters.Select(c => new SQLCluster(this, c)).ToList();
     AllInstances = StandaloneInstances.Union(Clusters.SelectMany(n => n.Nodes)).ToList();
 }
Esempio n. 2
0
 static SQLModule()
 {
     StandaloneInstances = Current.Settings.SQL.Instances
                           .Select(i => new SQLInstance(i))
                           .Where(i => i.TryAddToGlobalPollers())
                           .ToList();
     Clusters     = Current.Settings.SQL.Clusters.Select(c => new SQLCluster(c)).ToList();
     AllInstances = StandaloneInstances.Union(Clusters.SelectMany(n => n.Nodes)).ToList();
 }
Esempio n. 3
0
        public SQLModule(IConfiguration config, PollingService poller) : base(config, poller)
        {
            AzureServers = Settings.Instances
                           .Where(i => i.Type == SQLSettings.InstanceType.Azure)
                           .Select(i => new SQLAzureServer(this, i))
                           .Where(i => i.TryAddToGlobalPollers())
                           .ToList();

            StandaloneInstances = Settings.Instances
                                  .Where(i => i.Type == SQLSettings.InstanceType.Default)
                                  .Select(i => new SQLInstance(this, i))
                                  .Where(i => i.TryAddToGlobalPollers())
                                  .ToList();

            Clusters = Settings.Clusters.Select(c => new SQLCluster(this, c)).ToList();

            AllInstances = StandaloneInstances
                           .Union(AzureServers.SelectMany(s => s.Instances.SafeData(true)))
                           .Union(Clusters.SelectMany(n => n.Nodes));
        }