예제 #1
0
 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);
 }
예제 #2
0
 public static IStatsDClient WithTotalAndMachineScope([NotNull] this IStatsDClient client)
 {
     return(client.WithScopes("Total", $"PerMachine.{Environment.MachineName}"));
 }
예제 #3
0
 public static IStatsDClient WithScope([NotNull] this IStatsDClient client, [CanBeNull] string nextPrefix)
 {
     return(string.IsNullOrEmpty(nextPrefix) ? client : client.WithScopes(nextPrefix));
 }