public override HeatMapCapacityData GetCapacitySummary(DirectoryIdentity objectIdentity, bool refreshData)
 {
     if (objectIdentity.Equals(base.TargetServer.Identity))
     {
         LoadContainer localServerData = this.GetLocalServerData(this.context.GetActiveBands());
         return(localServerData.ToCapacityData());
     }
     return(base.GetCapacitySummary(objectIdentity, refreshData));
 }
Example #2
0
        private HeatMapCapacityData GetDagCapacityDatum(DirectoryIdentity objectIdentity)
        {
            TopologyExtractorFactoryContext    topologyExtractorFactoryContext = this.serviceContext.GetTopologyExtractorFactoryContext();
            DirectoryDatabaseAvailabilityGroup directoryObject             = (DirectoryDatabaseAvailabilityGroup)this.serviceContext.Directory.GetDirectoryObject(objectIdentity);
            TopologyExtractorFactory           loadBalancingCentralFactory = topologyExtractorFactoryContext.GetLoadBalancingCentralFactory();
            LoadContainer loadContainer = loadBalancingCentralFactory.GetExtractor(directoryObject).ExtractTopology();

            return(loadContainer.ToCapacityData());
        }
Example #3
0
        private HeatMapCapacityData GetDatabaseCapacityDatum(DirectoryIdentity objectIdentity, bool refreshData, DirectoryIdentity localServerIdentity)
        {
            DirectoryDatabase directoryDatabase = (DirectoryDatabase)this.serviceContext.Directory.GetDirectoryObject(objectIdentity);
            DirectoryServer   directoryServer   = directoryDatabase.ActivationOrder.FirstOrDefault <DirectoryServer>();

            if (directoryServer == null || localServerIdentity.Equals(directoryServer.Identity))
            {
                TopologyExtractorFactoryContext topologyExtractorFactoryContext = this.serviceContext.GetTopologyExtractorFactoryContext();
                TopologyExtractorFactory        loadBalancingLocalFactory       = topologyExtractorFactoryContext.GetLoadBalancingLocalFactory(refreshData);
                LoadContainer loadContainer = loadBalancingLocalFactory.GetExtractor(directoryDatabase).ExtractTopology();
                return(loadContainer.ToCapacityData());
            }
            HeatMapCapacityData capacitySummary;

            using (ILoadBalanceService loadBalanceClientForDatabase = this.serviceContext.ClientFactory.GetLoadBalanceClientForDatabase(directoryDatabase))
            {
                capacitySummary = loadBalanceClientForDatabase.GetCapacitySummary(objectIdentity, refreshData);
            }
            return(capacitySummary);
        }
Example #4
0
        public HeatMapCapacityData ToCapacityData()
        {
            LoadContainer loadTopology = this.GetLoadTopology();

            return(loadTopology.ToCapacityData());
        }