use of com.cloudbees.jenkins.support.api.PrefilteredPrintedContent in project support-core-plugin by jenkinsci.
the class FileDescriptorLimit method addContents.
private void addContents(@NonNull Container container, @NonNull final Node node) {
Computer c = node.toComputer();
if (c == null) {
return;
}
if (c instanceof SlaveComputer && !Boolean.TRUE.equals(c.isUnix())) {
return;
}
if (!node.createLauncher(TaskListener.NULL).isUnix()) {
return;
}
String name;
if (node instanceof Jenkins) {
name = "master";
} else {
name = "slave/" + node.getNodeName();
}
container.add(new PrefilteredPrintedContent("nodes/{0}/file-descriptors.txt", name) {
@Override
protected void printTo(PrintWriter out, ContentFilter filter) {
out.println(node.getDisplayName());
out.println("======");
out.println();
try {
out.println(AsyncResultCache.get(node, fileDescriptorCache, new GetUlimit(filter), "file descriptor info", "N/A: Either no connection to node or no cached result"));
} catch (IOException e) {
Functions.printStackTrace(e, out);
} finally {
out.flush();
}
}
});
}
Aggregations