Class HTTPReporter

    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • metricRegistry

        @Nonnull
        private final com.codahale.metrics.MetricRegistry metricRegistry
        Registry of metrics.
      • metricFilter

        @Nonnull
        private final com.codahale.metrics.MetricFilter metricFilter
        Filter to apply.
      • rateUnit

        @Nonnull
        private final TimeUnit rateUnit
        Rate unit.
      • durationUnit

        @Nonnull
        private final TimeUnit durationUnit
        Duration unit.
      • httpClient

        @NonnullAfterInit
        private org.apache.http.client.HttpClient httpClient
        HTTP Client used to post the data.
      • httpClientSecurityParameters

        @Nullable
        private HttpClientSecurityParameters httpClientSecurityParameters
        HTTP client security parameters.
      • jsonMapper

        @NonnullAfterInit
        private com.fasterxml.jackson.databind.ObjectMapper jsonMapper
        JSON object mapper to produce output.
      • dateTimeFormat

        @Nullable
        private String dateTimeFormat
        Formatting string for DateFormat fields.
      • isInitialized

        private boolean isInitialized
        Whether this component has been initialized.
    • Method Detail

      • setHttpClient

        public void setHttpClient​(@Nonnull
                                  org.apache.http.client.HttpClient client)
        Set the HttpClient to use.
        Parameters:
        client - client to use
      • setCollectorURL

        public void setCollectorURL​(@Nonnull @NotEmpty
                                    String url)
        Set the collection point to supply the data to.
        Parameters:
        url - URL to post data to
      • setHttpClientSecurityParameters

        public void setHttpClientSecurityParameters​(@Nullable
                                                    HttpClientSecurityParameters params)
        Set the optional client security parameters.
        Parameters:
        params - the new client security parameters
      • setDateTimeFormat

        public void setDateTimeFormat​(@Nullable @NotEmpty
                                      String format)
        Set the DateFormat formatting string to apply when writing DateFormat-valued fields.
        Parameters:
        format - formatting string
      • stop

        public void stop()
        Overrides:
        stop in class com.codahale.metrics.ScheduledReporter
      • report

        public void report()
        Overrides:
        report in class com.codahale.metrics.ScheduledReporter
      • report

        public void report​(SortedMap<String,​com.codahale.metrics.Gauge> gauges,
                           SortedMap<String,​com.codahale.metrics.Counter> counters,
                           SortedMap<String,​com.codahale.metrics.Histogram> histograms,
                           SortedMap<String,​com.codahale.metrics.Meter> meters,
                           SortedMap<String,​com.codahale.metrics.Timer> timers)
        Specified by:
        report in class com.codahale.metrics.ScheduledReporter
      • buildHttpContext

        @Nonnull
        private org.apache.http.client.protocol.HttpClientContext buildHttpContext​(@Nonnull
                                                                                   org.apache.http.client.methods.HttpUriRequest request)
        Build the HttpClientContext instance to be used by the HttpClient.
        Parameters:
        request - the HTTP client request
        Returns:
        the client context instance