Ejemplo n.º 1
0
        private XElement GetQueueDiagnosticInfo(MRSDiagnosticArgument arguments)
        {
            DatabaseInformation databaseInformation = MapiUtils.FindServerForMdb(this.MdbGuid, null, null, FindServerFlags.AllowMissing);
            string argument = arguments.GetArgument <string>("queues");

            if (!string.IsNullOrEmpty(argument) && (databaseInformation.IsMissing || !CommonUtils.IsValueInWildcardedList(databaseInformation.DatabaseName, argument)))
            {
                return(null);
            }
            MRSQueueDiagnosticInfoXML mrsqueueDiagnosticInfoXML = new MRSQueueDiagnosticInfoXML
            {
                MdbGuid                  = this.MdbGuid,
                MdbName                  = databaseInformation.DatabaseName,
                LastJobPickup            = this.LastJobPickup,
                LastInteractiveJobPickup = this.LastInteractiveJobPickup,
                QueuedJobsCount          = this.QueuedJobsCount,
                InProgressJobsCount      = this.InProgressJobsCount,
                LastScanFailure          = this.LastScanFailure,
                MdbDiscoveryTimestamp    = this.MdbDiscoveryTimestamp,
                LastScanTimestamp        = this.LastScanTimestamp,
                LastScanDurationMs       = (int)this.LastScanDuration.TotalMilliseconds,
                NextRecommendedScan      = this.NextRecommendedScan,
                LastActiveJobFinishTime  = this.LastActiveJobFinishTime,
                LastActiveJobFinished    = this.LastActiveJobFinished
            };

            if (arguments.HasArgument("pickupresults"))
            {
                mrsqueueDiagnosticInfoXML.LastScanResults = this.LastScanResults;
            }
            return(mrsqueueDiagnosticInfoXML.ToDiagnosticInfo(null));
        }
Ejemplo n.º 2
0
        public XElement GetDiagnosticInfo(MRSDiagnosticArgument arguments)
        {
            string argument = arguments.GetArgument <string>("resources");

            if (!string.IsNullOrEmpty(argument) && !CommonUtils.IsValueInWildcardedList(this.ResourceName, argument) && !CommonUtils.IsValueInWildcardedList(this.ResourceType, argument))
            {
                return(null);
            }
            if (arguments.HasArgument("unhealthy") && !this.IsUnhealthy)
            {
                return(null);
            }
            return(this.GetDiagnosticInfoInternal(arguments));
        }
Ejemplo n.º 3
0
        public WlmResourceHealthMonitorDiagnosticInfoXML PopulateDiagnosticInfo(MRSDiagnosticArgument arguments)
        {
            if (arguments.HasArgument("unhealthy") && !this.IsUnhealthy)
            {
                return(null);
            }
            ResourceLoad currentLoad = this.GetCurrentLoad();
            WlmResourceHealthMonitorDiagnosticInfoXML wlmResourceHealthMonitorDiagnosticInfoXML = new WlmResourceHealthMonitorDiagnosticInfoXML
            {
                WlmResourceKey           = this.WlmResourceKey.ToString(),
                DynamicCapacity          = (double)this.DynamicCapacity,
                LoadState                = currentLoad.State.ToString(),
                LoadRatio                = currentLoad.LoadRatio,
                Metric                   = ((currentLoad.Metric != null) ? currentLoad.Metric.ToString() : string.Empty),
                IsDisabled               = (this.IsDisabled ? "true" : null),
                DynamicThrottingDisabled = (this.DynamicThrottlingDisabled ? "true" : null)
            };

            if (arguments.HasArgument("healthstats"))
            {
                wlmResourceHealthMonitorDiagnosticInfoXML.WlmHealthStatistics = this.healthTracker.GetStats();
            }
            return(wlmResourceHealthMonitorDiagnosticInfoXML);
        }
        internal TransferProgressTrackerXML GetDiagnosticInfo(MRSDiagnosticArgument arguments)
        {
            bool showTimeSlots = arguments.HasArgument("showtimeslots");

            return(new TransferProgressTrackerXML(this, showTimeSlots));
        }
Ejemplo n.º 5
0
        XElement IDiagnosable.GetDiagnosticInfo(DiagnosableParameters parameters)
        {
            XElement xelement = new XElement(MRSService.DiagnosticsComponentName);
            MRSDiagnosticArgument arguments;

            try
            {
                arguments = new MRSDiagnosticArgument(parameters.Argument);
            }
            catch (DiagnosticArgumentException ex)
            {
                xelement.Add(new XElement("Error", "Encountered exception: " + ex.Message));
                return(xelement);
            }
            xelement.Add(new object[]
            {
                new XElement("ServiceStartTime", MRSService.serviceStartTime),
                new XElement("LastScanDuration", MRSService.lastFullScanDuration),
                new XElement("LastScanTime", MRSService.lastFullScanTime.ToString()),
                new XElement("DurationSinceLastScan", (long)(DateTime.UtcNow - MRSService.lastFullScanTime).TotalMilliseconds),
                new XElement("NextFullScanTime", MRSService.NextFullScanTime.ToString()),
                new XElement("NextLightJobsFullScanTime", MRSService.nextLightJobsFullScanTime.ToString())
            });
            if (arguments.ArgumentCount == 0)
            {
                xelement.Add(new XElement("Help", "Supported arguments: " + arguments.GetSupportedArguments()));
            }
            if (arguments.HasArgument("binaryversions"))
            {
                string assemblyNamePattern = arguments.GetArgument <string>("binaryversions");
                xelement.Add(arguments.RunDiagnosticOperation(() => CommonUtils.GetBinaryVersions(assemblyNamePattern)));
            }
            if (arguments.HasArgument("job"))
            {
                xelement.Add(arguments.RunDiagnosticOperation(() => MailboxSyncerJobs.GetJobsDiagnosticInfo(arguments)));
            }
            if (arguments.HasArgument("reservations"))
            {
                xelement.Add(arguments.RunDiagnosticOperation(() => ReservationManager.GetReservationsDiagnosticInfo(arguments)));
            }
            if (arguments.HasArgument("resources"))
            {
                xelement.Add(arguments.RunDiagnosticOperation(() => ReservationManager.GetResourcesDiagnosticInfo(arguments)));
            }
            if (arguments.HasArgument("queues"))
            {
                xelement.Add(arguments.RunDiagnosticOperation(() => MRSQueue.GetDiagnosticInfo(arguments)));
            }
            if (arguments.HasArgument("workloads"))
            {
                XElement xelement2 = new XElement("Workloads");
                foreach (object obj in Enum.GetValues(typeof(RequestWorkloadType)))
                {
                    RequestWorkloadType requestWorkloadType = (RequestWorkloadType)obj;
                    if (requestWorkloadType != RequestWorkloadType.None)
                    {
                        GenericSettingsContext genericSettingsContext = new GenericSettingsContext("RequestWorkloadType", requestWorkloadType.ToString(), null);
                        using (genericSettingsContext.Activate())
                        {
                            bool config = ConfigBase <MRSConfigSchema> .GetConfig <bool>("IsJobPickupEnabled");

                            xelement2.Add(new XElement("Workload", new object[]
                            {
                                new XAttribute("Name", requestWorkloadType.ToString()),
                                new XAttribute("IsJobPickupEnabled", config)
                            }));
                        }
                    }
                }
                xelement.Add(xelement2);
            }
            return(xelement);
        }