コード例 #1
0
 public IMetricsCollectorBuilder AddEndpoint(string name, IMetricHandler handler)
 {
     _metricEndpoints.Add(new MetricEndpoint(name, handler));
     return(this);
 }
コード例 #2
0
 /// <summary>
 /// Constructs a new <see cref="SignalFxMetricHandler" /> pointing at the specified <see cref="Uri" />.
 /// </summary>
 /// <param name="baseUri">
 /// <see cref="Uri" /> of a SignalFx endpoint.
 /// </param>
 /// <remarks>
 /// If the URI points at a UDP endpoint then a StatsD endpoint is assumed, otherwise if the URI
 /// is HTTP or HTTPS then a REST endpoint is assumed
 /// </remarks>
 public SignalFxMetricHandler(Uri baseUri)
 {
     _baseUri       = baseUri;
     _activeHandler = GetHandler();
 }
コード例 #3
0
 /// <summary>
 /// Constructs a new <see cref="SignalFxMetricHandler" /> pointing at the specified <see cref="Uri" />
 /// and using the specified access token.
 /// </summary>
 /// <param name="baseUri">
 /// <see cref="Uri" /> of a SignalFx endpoint.
 /// </param>
 /// <param name="accessToken">
 /// An access token.
 /// </param>
 /// <remarks>
 /// If the URI points at a UDP endpoint then a StatsD endpoint is assumed, otherwise if the URI
 /// is HTTP or HTTPS then a REST endpoint is assumed
 /// </remarks>
 public SignalFxMetricHandler(Uri baseUri, string accessToken)
 {
     _accessToken   = accessToken ?? throw new ArgumentNullException(nameof(accessToken));
     _baseUri       = baseUri;
     _activeHandler = GetHandler();
 }
コード例 #4
0
 public PollResultsController(IContextFactory contextFactory, IMetricHandler metricHandler) : base(contextFactory, metricHandler)
 {
 }
コード例 #5
0
 public PollVoteController(IContextFactory contextFactory, IMetricHandler metricHandler, IVoteValidatorFactory voteValidatorFactory)
     : base(contextFactory, metricHandler)
 {
     _voteValidatorFactory = voteValidatorFactory;
 }
コード例 #6
0
 public RoutesController(IMetricHandler metricHandler)
 {
     _metricHandler = metricHandler ?? new EmptyMetricHandler();
 }
コード例 #7
0
 public ManageExpiryController(IContextFactory contextFactory, IMetricHandler metricHandler) : base(contextFactory, metricHandler)
 {
 }
コード例 #8
0
 public ManagePollTypeController(IContextFactory contextFactory, IMetricHandler metricHandler) : base(contextFactory, metricHandler)
 {
 }
コード例 #9
0
 public ManageQuestionController(IContextFactory contextFactory, IMetricHandler metricHandler) : base(contextFactory, metricHandler)
 {
 }
コード例 #10
0
 public ManageInvitationController(IContextFactory contextFactory, IMetricHandler metricHandler, ICorrespondenceService correspondenceService)
     : base(contextFactory, metricHandler)
 {
     _correspondenceService = correspondenceService;
 }
コード例 #11
0
 public DashboardController CreateDashboardController(IContextFactory contextFactory, IMetricHandler metricHandler)
 {
     return(new DashboardController(contextFactory, metricHandler)
     {
         Request = new HttpRequestMessage(),
         Configuration = new HttpConfiguration()
     });
 }
コード例 #12
0
 public WebApiController(IContextFactory contextFactory, IMetricHandler metricHandler)
 {
     _contextFactory = contextFactory;
     _metricHandler  = metricHandler ?? new EmptyMetricHandler();
 }
コード例 #13
0
 public WebApiController()
 {
     _contextFactory = new ContextFactory();
     _metricHandler  = new MetricHandler(_contextFactory);
 }
コード例 #14
0
 public PollChoiceController(IContextFactory contextFactory, IMetricHandler metricHandler) : base(contextFactory, metricHandler)
 {
 }
コード例 #15
0
 public static ManagePollTypeController CreateManagePollTypeController(IContextFactory contextFactory, IMetricHandler metricHandler)
 {
     return(new ManagePollTypeController(contextFactory, metricHandler)
     {
         Request = new HttpRequestMessage(),
         Configuration = new HttpConfiguration()
     });
 }
コード例 #16
0
 public DashboardController(IContextFactory contextFactory, IMetricHandler metricHandler) : base(contextFactory, metricHandler)
 {
 }
コード例 #17
0
 /// <summary>
 /// Constructs a new endpoint with the specific name and <see cref="IMetricHandler"/>.
 /// </summary>
 /// <param name="name">
 /// Name of the endpoint.
 /// </param>
 /// <param name="handler">
 /// An <see cref="IMetricHandler"/> used to serialize and metrics.
 /// </param>
 public MetricEndpoint(string name, IMetricHandler handler)
 {
     Name    = name ?? throw new ArgumentNullException(nameof(name));
     Handler = handler ?? throw new ArgumentNullException(nameof(handler));
 }
コード例 #18
0
        public RoutesController()
        {
            var ContextFactory = new ContextFactory();

            _metricHandler = new MetricHandler(ContextFactory);
        }