internal static void ParseStatistics(IStatisticsConfiguration config, XmlElement root, string nodeName) { if (root.HasAttribute("ProviderType")) { config.StatisticsProviderName = root.GetAttribute("ProviderType"); } if (root.HasAttribute("MetricsTableWriteInterval")) { config.StatisticsMetricsTableWriteInterval = ParseTimeSpan(root.GetAttribute("MetricsTableWriteInterval"), "Invalid TimeSpan value for Statistics.MetricsTableWriteInterval attribute on Statistics element for " + nodeName); } if (root.HasAttribute("PerfCounterWriteInterval")) { config.StatisticsPerfCountersWriteInterval = ParseTimeSpan(root.GetAttribute("PerfCounterWriteInterval"), "Invalid TimeSpan value for Statistics.PerfCounterWriteInterval attribute on Statistics element for " + nodeName); } if (root.HasAttribute("LogWriteInterval")) { config.StatisticsLogWriteInterval = ParseTimeSpan(root.GetAttribute("LogWriteInterval"), "Invalid TimeSpan value for Statistics.LogWriteInterval attribute on Statistics element for " + nodeName); } if (root.HasAttribute("WriteLogStatisticsToTable")) { config.StatisticsWriteLogStatisticsToTable = ParseBool(root.GetAttribute("WriteLogStatisticsToTable"), "Invalid bool value for Statistics.WriteLogStatisticsToTable attribute on Statistics element for " + nodeName); } if (root.HasAttribute("StatisticsCollectionLevel")) { config.StatisticsCollectionLevel = ConfigUtilities.ParseEnum <StatisticsLevel>(root.GetAttribute("StatisticsCollectionLevel"), "Invalid value of for Statistics.StatisticsCollectionLevel attribute on Statistics element for " + nodeName); } }
internal static void CopyStatisticsOptions(IStatisticsConfiguration configuration, StatisticsOptions options) { options.MetricsTableWriteInterval = configuration.StatisticsMetricsTableWriteInterval; options.PerfCountersWriteInterval = configuration.StatisticsPerfCountersWriteInterval; options.LogWriteInterval = configuration.StatisticsLogWriteInterval; options.WriteLogStatisticsToTable = configuration.StatisticsWriteLogStatisticsToTable; options.CollectionLevel = configuration.StatisticsCollectionLevel; }
private static bool ShouldUseExternalMetricsProvider( Silo silo, IStatisticsConfiguration nodeConfig, out bool useAzureTable) { useAzureTable = silo.GlobalConfig.LivenessType == GlobalConfiguration.LivenessProviderType.AzureTable && !string.IsNullOrEmpty(silo.GlobalConfig.DeploymentId) && !string.IsNullOrEmpty(silo.GlobalConfig.DataConnectionString); return(!string.IsNullOrEmpty(nodeConfig.StatisticsProviderName)); }
internal static string IStatisticsConfigurationToString(IStatisticsConfiguration config) { var sb = new StringBuilder(); sb.Append(" Statistics: ").AppendLine(); sb.Append(" PerfCounterWriteInterval: ").Append(config.StatisticsPerfCountersWriteInterval).AppendLine(); sb.Append(" LogWriteInterval: ").Append(config.StatisticsLogWriteInterval).AppendLine(); sb.Append(" StatisticsCollectionLevel: ").Append(config.StatisticsCollectionLevel).AppendLine(); return(sb.ToString()); }
private bool ShouldUseExternalMetricsProvider( Silo silo, IStatisticsConfiguration nodeConfig, out bool useAzureTable) { // TODO: use DI to configure this and don't rely on GlobalConfiguration nor NodeConfiguration useAzureTable = silo.GlobalConfig.LivenessType == GlobalConfiguration.LivenessProviderType.AzureTable && !string.IsNullOrEmpty(this.siloOptions.ClusterId) && !string.IsNullOrEmpty(silo.GlobalConfig.DataConnectionString); return(!string.IsNullOrEmpty(nodeConfig.StatisticsProviderName)); }
internal static string IStatisticsConfigurationToString(IStatisticsConfiguration config) { var sb = new StringBuilder(); sb.Append(" Statistics: ").AppendLine(); sb.Append(" PerfCounterWriteInterval: ").Append(config.StatisticsPerfCountersWriteInterval).AppendLine(); sb.Append(" LogWriteInterval: ").Append(config.StatisticsLogWriteInterval).AppendLine(); sb.Append(" StatisticsCollectionLevel: ").Append(config.StatisticsCollectionLevel).AppendLine(); #if TRACK_DETAILED_STATS sb.Append(" TRACK_DETAILED_STATS: true").AppendLine(); #endif return(sb.ToString()); }
internal static void ParseStatistics(IStatisticsConfiguration config, XmlElement root, string nodeName) { if (root.HasAttribute("PerfCounterWriteInterval")) { config.StatisticsPerfCountersWriteInterval = ParseTimeSpan(root.GetAttribute("PerfCounterWriteInterval"), "Invalid TimeSpan value for Statistics.PerfCounterWriteInterval attribute on Statistics element for " + nodeName); } if (root.HasAttribute("LogWriteInterval")) { config.StatisticsLogWriteInterval = ParseTimeSpan(root.GetAttribute("LogWriteInterval"), "Invalid TimeSpan value for Statistics.LogWriteInterval attribute on Statistics element for " + nodeName); } if (root.HasAttribute("StatisticsCollectionLevel")) { config.StatisticsCollectionLevel = ConfigUtilities.ParseEnum <StatisticsLevel>(root.GetAttribute("StatisticsCollectionLevel"), "Invalid value of for Statistics.StatisticsCollectionLevel attribute on Statistics element for " + nodeName); } }
internal static string IStatisticsConfigurationToString(IStatisticsConfiguration config) { var sb = new StringBuilder(); sb.Append(" Statistics: ").AppendLine(); sb.Append(" MetricsTableWriteInterval: ").Append(config.StatisticsMetricsTableWriteInterval).AppendLine(); sb.Append(" PerfCounterWriteInterval: ").Append(config.StatisticsPerfCountersWriteInterval).AppendLine(); sb.Append(" LogWriteInterval: ").Append(config.StatisticsLogWriteInterval).AppendLine(); sb.Append(" WriteLogStatisticsToTable: ").Append(config.StatisticsWriteLogStatisticsToTable).AppendLine(); sb.Append(" StatisticsCollectionLevel: ").Append(config.StatisticsCollectionLevel).AppendLine(); #if TRACK_DETAILED_STATS sb.Append(" TRACK_DETAILED_STATS: true").AppendLine(); #endif if (!string.IsNullOrEmpty(config.StatisticsProviderName)) { sb.Append(" StatisticsProviderName:").Append(config.StatisticsProviderName).AppendLine(); } return(sb.ToString()); }
public static void Initialize(IStatisticsConfiguration config) { StatisticsCollectionLevel = config.StatisticsCollectionLevel; }
internal ClientStatisticsManager(IStatisticsConfiguration config) { runtimeStats = new RuntimeStatisticsGroup(); logStatistics = new LogStatistics(config.StatisticsLogWriteInterval, false); }
internal ClientStatisticsManager(IStatisticsConfiguration config) { runtimeStats = new RuntimeStatisticsGroup(); logStatistics = new LogStatistics(config.StatisticsLogWriteInterval, false); logger = TraceLogger.GetLogger(GetType().Name); }
private static bool ShouldUseExternalMetricsProvider( Silo silo, IStatisticsConfiguration nodeConfig, out bool useAzureTable) { useAzureTable = silo.GlobalConfig.LivenessType == GlobalConfiguration.LivenessProviderType.AzureTable && !string.IsNullOrEmpty(silo.GlobalConfig.DeploymentId) && !string.IsNullOrEmpty(silo.GlobalConfig.DataConnectionString); return !string.IsNullOrEmpty(nodeConfig.StatisticsProviderName); }