public GraphiteRtqProfiler([NotNull] IStatsDClient statsDClient, [NotNull] IGraphiteClient graphiteClient, [NotNull] string statsDKeyNamePrefix, [NotNull] string consumerGraphitePathPrefix) { if (string.IsNullOrEmpty(statsDKeyNamePrefix)) { throw new InvalidOperationException("statsDKeyNamePrefix is empty"); } if (string.IsNullOrEmpty(consumerGraphitePathPrefix)) { throw new InvalidOperationException("consumerGraphitePathPrefix is empty"); } this.statsDClient = statsDClient.WithScopes($"{statsDKeyNamePrefix}.{Dns.GetHostName()}", $"{statsDKeyNamePrefix}.Total"); this.graphiteClient = graphiteClient; this.consumerGraphitePathPrefix = FormatGraphitePathPrefix(consumerGraphitePathPrefix); }
public static IStatsDClient WithTotalAndMachineScope([NotNull] this IStatsDClient client) { return(client.WithScopes("Total", $"PerMachine.{Environment.MachineName}")); }
public static IStatsDClient WithScope([NotNull] this IStatsDClient client, [CanBeNull] string nextPrefix) { return(string.IsNullOrEmpty(nextPrefix) ? client : client.WithScopes(nextPrefix)); }