如何通过Groovy脚本获取Jenkins指标

时间:2019-02-09 12:49:50

标签: jenkins-groovy

https://github.com/cloudbees/jenkins-scripts/blob/master/print-available-metrics.groovy

下面获得代码
```for (j in Jenkins.instance.getExtensionList(jenkins.metrics.api.MetricProvider.class)) {
  for (m in j.getMetricSet()) {
    for (i in m.metrics) {
    println i.getKey()
    }
  }

}```

it's prints only keys:

    jenkins.health-check.duration
    jenkins.health-check.count
    jenkins.health-check.score
    jenkins.health-check.inverse-score
    jenkins.queue.size
    jenkins.queue.blocked
    jenkins.queue.buildable
    jenkins.queue.stuck
    jenkins.queue.pending

    but how to get those corresponding values?? can someone help me out??

    Thanks,
    Krishna.

0 个答案:

没有答案