From 20b80cc6a05520303c500c4d6cd52361fa9e94c2 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 24 May 2013 16:38:45 -0400 Subject: [PATCH] Display classLoadingPrefetchCacheCount. --- .../main/java/hudson/slaves/SlaveComputer.java | 18 ++++++++++++++++++ .../slaves/SlaveComputer/statistics.groovy | 10 +++++++++- pom.xml | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java index cdffb6d5f7..97a2578f44 100644 --- a/core/src/main/java/hudson/slaves/SlaveComputer.java +++ b/core/src/main/java/hudson/slaves/SlaveComputer.java @@ -348,6 +348,18 @@ public class SlaveComputer extends Computer { return channel.call(new LoadingCount(false)); } + /** + * Shows {@link Channel#classLoadingPrefetchCacheCount}. + * @return -1 in case that capability is not supported + * @since XXX prefetch-JENKINS-15120 + */ + public int getClassLoadingPrefetchCacheCount() throws IOException, InterruptedException { + if (!channel.remoteCapability.supportsPrefetch()) { + return -1; + } + return channel.call(new LoadingPrefetchCacheCount()); + } + /** * Shows {@link Channel#resourceLoadingCount}. * @since 1.495 @@ -383,6 +395,12 @@ public class SlaveComputer extends Computer { } } + static class LoadingPrefetchCacheCount implements Callable { + @Override public Integer call() { + return Channel.current().classLoadingPrefetchCacheCount.get(); + } + } + static class LoadingTime implements Callable { private final boolean resource; LoadingTime(boolean resource) { diff --git a/core/src/main/resources/hudson/slaves/SlaveComputer/statistics.groovy b/core/src/main/resources/hudson/slaves/SlaveComputer/statistics.groovy index f0b62d524e..6a801364f9 100644 --- a/core/src/main/resources/hudson/slaves/SlaveComputer/statistics.groovy +++ b/core/src/main/resources/hudson/slaves/SlaveComputer/statistics.groovy @@ -10,7 +10,15 @@ table(class: 'bigtable') { tr { td _('Classes') td(style: right) {text(fmt.format(my.classLoadingTime / 1000000000))} - td(style: right) {text(my.classLoadingCount)} + td(style: right) { + text(my.classLoadingCount) + def classLoadingPrefetchCacheCount = my.classLoadingPrefetchCacheCount; + if (classLoadingPrefetchCacheCount != -1) { + text(_(' (prefetch cache: ')) + text(classLoadingPrefetchCacheCount) + text(_(')')) + } + } } tr { td _('Resources') diff --git a/pom.xml b/pom.xml index 45a72f733f..88c02655e1 100644 --- a/pom.xml +++ b/pom.xml @@ -175,7 +175,7 @@ THE SOFTWARE. org.jenkins-ci.main remoting - 2.23 + 2.24-SNAPSHOT -- GitLab