Class HTTPReporter

    • Field Detail

      • log

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

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

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

        private final TimeUnit rateUnit
        Rate unit.
      • durationUnit

        private final TimeUnit durationUnit
        Duration unit.
      • httpClient

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

        private HttpClientSecurityParameters httpClientSecurityParameters
        HTTP client security parameters.
      • jsonMapper

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

        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.
        client - client to use
      • setCollectorURL

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

        public void setHttpClientSecurityParameters​(@Nullable
                                                    HttpClientSecurityParameters params)
        Set the optional client security 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.
        format - formatting string
      • stop

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

        public void report()
        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

        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.
        request - the HTTP client request
        the client context instance