Class MetricSettings

java.lang.Object
com.codingchili.core.metrics.MetricSettings

public class MetricSettings extends Object
Settings for the generation of metrics.
  • Field Details

  • Constructor Details

    • MetricSettings

      public MetricSettings()
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Returns:
      true if metrics should be collected.
    • setEnabled

      public MetricSettings setEnabled(boolean enabled)
    • getIncludes

      public Set<String> getIncludes()
    • setIncludes

      public MetricSettings setIncludes(Set<String> includes)
      Parameters:
      includes - a list of default includes for the filters.
      Returns:
      fluent
    • include

      public MetricSettings include(String include)
      Parameters:
      include - a property to include for matching metrics.
      Returns:
      fluent.
    • getRate

      public int getRate()
      Returns:
      the rate in ms at which metrics are collected.
    • setRate

      public MetricSettings setRate(int rate)
      Parameters:
      rate - in milliseconds.
      Returns:
      fluent.
    • getFilters

      public List<MetricFilter> getFilters()
      Returns:
      a list of filters used to filter out performance metrics to greatly reduce the overhead of collection and indexing. If empty nothing will be filtered.
    • setFilters

      public MetricSettings setFilters(List<MetricFilter> filters)
    • addFilter

      public MetricSettings addFilter(Consumer<MetricFilter> consumer)
      Adds a new filter to the metric configuration.
      Parameters:
      consumer - the configurator.
      Returns:
      fluent.
    • isOverhead

      public boolean isOverhead()
    • setOverhead

      public MetricSettings setOverhead(boolean overhead)
      Parameters:
      overhead - true if reporting overhead should be recorded.
      Returns:
      fluent
    • allJvm

      public MetricSettings allJvm()
      enables all jvm performance metrics.
      Returns:
      fluent.
    • getJvm

      public List<JvmMetric> getJvm()
    • setJvm

      public MetricSettings setJvm(List<JvmMetric> jvm)
      Parameters:
      jvm - a set of jvm metrics to enable.
      Returns:
      fluent.
    • jvm

      public MetricSettings jvm(JvmMetric... metrics)
      Parameters:
      metrics - a list of jvm metrics to enable.
      Returns:
      fluent.
    • createVertxOptions

      public io.vertx.core.metrics.MetricsOptions createVertxOptions()
      Returns:
      metrics options which are passed to vertx.
    • filter

      public io.vertx.core.json.JsonObject filter(io.vertx.core.json.JsonObject json)