You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Andrzej Bialecki (JIRA)" <ji...@apache.org> on 2017/05/09 11:58:04 UTC

[jira] [Created] (SOLR-10649) Document new metrics config changes

Andrzej Bialecki  created SOLR-10649:
----------------------------------------

             Summary: Document new metrics config changes
                 Key: SOLR-10649
                 URL: https://issues.apache.org/jira/browse/SOLR-10649
             Project: Solr
          Issue Type: Task
      Security Level: Public (Default Security Level. Issues are Public)
          Components: documentation, metrics
    Affects Versions: master (7.0)
            Reporter: Andrzej Bialecki 


SOLR-10262 made several improvements to the configuration of metrics in Solr.

Internally, the {{<metrics>}} configuration section of {{solr.xml}} is now represented as {{MetricsConfig}} class, which makes it easier to add new properties there.

A new section {{<solr><metrics><suppliers>}} has been added to {{solr.xml}}, which allows users to define what implementations of metrics they want to use as well as to configure their parameters. This is useful eg. when selecting what kind of reservoir to use for histograms and timers, or to change the reference clock type, or for providing any other configuration parameters for custom implementations of metrics.

The {{<suppliers>}} section specifies implementations and configurations of metric suppliers, ie. classes responsible for creating instances of metrics. There are default implementations provided for all types of metrics, and they are used if no {{class}} attribute is specified, or an invalid one. Custom suppliers must implement {{MetricSupplier<T>}} interface and have a zero-args constructor. Bean setter methods will be used for applying values from their plugin configuration, alternatively they may also implement {{PluginInfoInitialized}}. These rules also apply to any other custom classes loaded in the metrics config, eg. custom Reservoir implementations.

Each configuration element in the {{<suppliers>}} section follows a general plugin configuration format, ie. it may optionally contain "name" and "class" attributes and contain sub-elements that define typed configuration parameters. As mentioned above, if the "class" attribute is missing or invalid (the class can't be loaded or it doesn't implement the right interface) a default implementation will be used. If an element is missing then default configuration will be used.

The following elements are supported in this section:
* {{<counter>}} - this element defines the implementation and configuration of a {{Counter}} supplier. The default implementation doesn't support any configuration.
* {{<meter>}} - implementation and configuration of a {{Meter}} supplier. The default implementation supports one optional config parameter:
** {{<str name="clock">}} - type of clock to use for calculating EWMA rates; supported values are "user" (default, which uses {{System.nanoTime()}}) and "cpu" (which uses current thread's CPU time).
* {{<histogram>}} - implementation and configuration of a {{Histogram}} supplier. In addition to the {{clock}} parameter the following parameters are supported by the default supplier implementation:
** {{<str name="reservoir">}} - a fully-qualified class name of implementation of {{Reservoir}} to use. Default value is {{com.codahale.metrics.ExponentiallyDecayingReservoir}}. Note: all implementations of {{Reservoir}} that ship with the metrics library are supported, even though they don't follow the custom class rules listed above. The following config parameters can be used with these implementations:
*** {{size}} - (int, default is 1028) reservoir size.
*** {{alpha}} - (double, default is 0.015) decay parameter for {{ExponentiallyDecayingReservoir}}.
*** {{window}} - (long, default is 300) window size parameter for {{SlidingTimeWindowReservoir}}, in seconds. 300 seconds = 5 minutes, which more or less fits the default bias of {{ExponentiallyDecayingReservoir}}.
* {{<timer>}} - implementation and configuration of a {{Timer}} supplier. Default implementation supports configuration parameters related to clock and reservoir, as specified above.

Example section of {{solr.xml}}. The default {{Meter}} supplier is used with non-default clock, and the default {{Timer}} supplier is used but with a non-default reservoir configuration:
{code}
<solr>
 <metrics>
  <suppliers>
    <meter>
      <str name="clock">cpu</str>
    </meter>
    <timer>
      <str name="reservoir">com.codahale.metrics.SlidingTimeWindowReservoir</str>
      <long name="window">600</long>
    </timer>
   </suppliers>
  </metrics>
</solr>
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org