Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-76051

MetricsRootAction.Sampler.isEnabled returns false when sampler should be enabled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • metrics-plugin
    • None

      The Metrics plugin has code for collecting the history of metrics to an ExponentialLeakyBucket<T> and serving it over HTTP at /metrics/metricsHistory, but it does not work because the MetricsRootAction.Sampler.isEnabled() method returns the wrong boolean, ever since JENKINS-32696 pull request jenkinsci/metrics-plugin#20.

      MetricsRootAction.Sampler.SIZE has 128 as its default value, and the javadoc says negative sizes should disable the sampler.

      MetricsRootAction.Sampler.isEnabled() is implemented incorrectly, returning false when SIZE is positive.

      MetricsRootAction.doMetricsHistory then returns a 404 Not Found response because Sampler.isEnabled() returned false.

            Unassigned Unassigned
            kon Kalle Niemitalo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: