Пример #1
0
        /// <summary>
        /// Overloaded ToString function for formatting the output on the console.
        /// </summary>
        /// <param name="serviceHealth"> Object of type ServiceHealth </param>
        /// <returns>
        /// Returns formatted string.
        /// </returns>
        public static string ToString(ServiceHealth serviceHealth)
        {
            var strBuilder = new StringBuilder();

            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0} : {1}", "ServiceName", serviceHealth.Name));
            strBuilder.Append(Environment.NewLine);
            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0} : {1}", "PartitionHealthStates", OutputFormatter.ToString(serviceHealth.PartitionHealthStates.ToList())));
            strBuilder.Append(Environment.NewLine);
            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0} : {1}", "AggregatedHealthState", serviceHealth.AggregatedHealthState));
            strBuilder.Append(Environment.NewLine);
            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0} : {1}", "HealthEvents", OutputFormatter.ToString(serviceHealth.HealthEvents.ToList())));
            strBuilder.Append(Environment.NewLine);
            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0} : {1}", "HealthStatistics", OutputFormatter.ToString(serviceHealth.HealthStatistics)));
            strBuilder.Append(Environment.NewLine);

            return(strBuilder.ToString());
        }
Пример #2
0
        /// <summary>
        /// Overloaded ToString function for formatting the output on the console.
        /// </summary>
        /// <param name="entityKindHealthStateCount"> Object of type EntityKindHealthStateCount </param>
        /// <returns>
        /// Returns formatted string.
        /// </returns>
        public static string ToString(EntityKindHealthStateCount entityKindHealthStateCount)
        {
            var strBuilder = new StringBuilder();

            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0, -21} : {1}", "EntityKind", entityKindHealthStateCount.EntityKind));
            strBuilder.Append(Environment.NewLine);
            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0, -21} : \n{1}", "HealthStateCount", OutputFormatter.ToString(entityKindHealthStateCount.HealthStateCount)));
            strBuilder.Append(Environment.NewLine);

            return(strBuilder.ToString());
        }
Пример #3
0
        /// <summary>
        /// Overloaded ToString function for formatting the output on the console.
        /// </summary>
        /// <param name="healthStatistics"> Object of type HealthStatistics </param>
        /// <returns>
        /// Returns formatted string.
        /// </returns>
        public static string ToString(HealthStatistics healthStatistics)
        {
            var strBuilder = new StringBuilder();

            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0, -21} : {1}", "HealthStateCountList", OutputFormatter.ToString(healthStatistics.HealthStateCountList.ToList())));
            strBuilder.Append(Environment.NewLine);

            return(strBuilder.ToString());
        }
Пример #4
0
        /// <summary>
        /// Overloaded ToString function for formatting the output on the console.
        /// </summary>
        /// <param name="clusterHealth"> Object of type ClusterHealth </param>
        /// <returns>
        /// Returns formatted string.
        /// </returns>
        public static string ToString(ClusterHealth clusterHealth)
        {
            var strBuilder = new StringBuilder();

            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0} : {1}", "AggregatedHealthState", clusterHealth.AggregatedHealthState));
            strBuilder.Append(Environment.NewLine);
            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0} : {1}", "NodeHealthStates", OutputFormatter.ToString(clusterHealth.NodeHealthStates.ToList())));
            strBuilder.Append(Environment.NewLine);
            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0} : {1}", "ApplicationHealthStates", OutputFormatter.ToString(clusterHealth.ApplicationHealthStates.ToList())));
            strBuilder.Append(Environment.NewLine);
            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0} : {1}", "HealthEvents", OutputFormatter.ToString(clusterHealth.HealthEvents.ToList())));
            strBuilder.Append(Environment.NewLine);
            strBuilder.Append(string.Format(CultureInfo.CurrentCulture, "{0} : {1}", "HealthStatistics", OutputFormatter.ToString(clusterHealth.HealthStatistics)));
            strBuilder.Append(Environment.NewLine);

            return(strBuilder.ToString());
        }