コード例 #1
0
        /// <summary> Return dump of diagnostic data from this silo. </summary>
        /// <param name="all"></param>
        /// <returns>Debug data for this silo.</returns>
        public string GetDebugDump(bool all = true)
        {
            var sb = new StringBuilder();

            foreach (var sytemTarget in activationDirectory.AllSystemTargets())
            {
                sb.AppendFormat("System target {0}:", sytemTarget.GrainId.ToString()).AppendLine();
            }

            var enumerator = activationDirectory.GetEnumerator();

            while (enumerator.MoveNext())
            {
                var activationData = enumerator.Current.Value;
                var workItemGroup  = scheduler.GetWorkItemGroup(new SchedulingContext(activationData));
                if (workItemGroup == null)
                {
                    sb.AppendFormat("Activation with no work item group!! Grain {0}, activation {1}.", activationData.Grain,
                                    activationData.ActivationId);
                    sb.AppendLine();
                    continue;
                }

                if (all || activationData.IsUsable)
                {
                    sb.AppendLine(workItemGroup.DumpStatus());
                    sb.AppendLine(activationData.DumpStatus());
                }
            }
            logger.Info(ErrorCode.SiloDebugDump, sb.ToString());
            return(sb.ToString());
        }
コード例 #2
0
        /// <summary> Return dump of diagnostic data from this silo. </summary>
        /// <param name="all"></param>
        /// <returns>Debug data for this silo.</returns>
        public string GetDebugDump(bool all = true)
        {
            var sb = new StringBuilder();

            foreach (var systemTarget in activationDirectory.AllSystemTargets())
            {
                sb.AppendFormat("System target {0}:", ((ISystemTargetBase)systemTarget).GrainId.ToString()).AppendLine();
            }

            var enumerator = activationDirectory.GetEnumerator();

            while (enumerator.MoveNext())
            {
                Utils.SafeExecute(() =>
                {
                    var activationData = enumerator.Current.Value;
                    var workItemGroup  = scheduler.GetWorkItemGroup(activationData.SchedulingContext);
                    if (workItemGroup == null)
                    {
                        sb.AppendFormat("Activation with no work item group!! Grain {0}, activation {1}.",
                                        activationData.Grain,
                                        activationData.ActivationId);
                        sb.AppendLine();
                        return;
                    }

                    if (all || activationData.State.Equals(ActivationState.Valid))
                    {
                        sb.AppendLine(workItemGroup.DumpStatus());
                        sb.AppendLine(activationData.DumpStatus());
                    }
                });
            }
            logger.Info(ErrorCode.SiloDebugDump, sb.ToString());
            return(sb.ToString());
        }