コード例 #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));
 }