@Override public boolean acceptGraph(GraphNode graph, String path) { return (graph.getProbe() instanceof ContainerProbe); }
public String resolve(GraphNode graph) { JdbcProbe dbprobe = (JdbcProbe) graph.getProbe(); return dbprobe.getUrlAsString(); } };
/** * @param end the end to set */ public void setEnd(Date end) { // We normalize the last update time, it can't be used directly this.end = Util.endDate(node.getProbe(), end); }
public String resolve(GraphNode graph) { String url = ""; Probe<?, ?> probe = graph.getProbe(); if(probe instanceof UrlProbe) { url = ((UrlProbe) probe).getUrlAsString(); } return url; } },
public String resolve(GraphNode graph) { return ((JdbcProbe) graph.getProbe()).getUrlAsString(); } },
protected long getEndSec() { return Util.endDate(node.getProbe(), end).getTime() / 1000; }
public String resolve(GraphNode graph) { StringBuilder retValue = new StringBuilder("empty"); if(graph.getProbe() instanceof IndexedProbe) { retValue.setLength(0); IndexedProbe ip = (IndexedProbe) graph.getProbe(); retValue.append(ip.getIndexName()); // Check to see if a label is defined and needed to add String label = graph.getProbe().getLabel(); if(label != null) { retValue.append(" (").append(label).append(")"); } } else { logger.debug("Bad graph definition for " + graph); } return retValue.toString(); } },
public LinkedList<String> getTree(GraphNode graph, String tabname) { List<?> elementsTree = trees.get(tabname); LinkedList<String> tree = new LinkedList<String>(); if(elementsTree == null) return tree; for(Object o: elementsTree) { if(o instanceof String) { String pathElem = jrds.Util.parseTemplate((String) o, graph.getProbe(), this, graph.getProbe().getHost()); tree.add(pathElem); } else if(o instanceof PathElement) tree.add(((PathElement) o).resolve(graph)); } return tree; }
public boolean acceptGraph(GraphNode graph, String path) { boolean accepted = false; // An explicit graph is always accepted if(names.contains(graph.getQualifiedName())) accepted = true; // if neither tags or path, it's refused else if(!tags.isEmpty() || !goodPaths.isEmpty()) accepted = (acceptPath(path) && acceptTag(graph.getProbe())); if(logger.isTraceEnabled()) logger.trace(Util.delayedFormatString("Tried to accept : %s=%s, %s: %b", path, graph.getQualifiedName(), graph.getProbe() != null ? graph.getProbe().getTags() : "", accepted)); return accepted; }
@Override public boolean acceptGraph(GraphNode graph, String path) { return graph.getProbe().getHost().getName().equals(hostname) && path.startsWith("/" + GraphTree.HOSTROOT + "/"); }
@Override public boolean acceptGraph(GraphNode graph, String path) { HostInfo host = graph.getProbe().getHost(); return (!host.isHidden()) && path.startsWith("/" + GraphTree.HOSTROOT + "/"); }
public Probe<?, ?> getProbe() { Probe<?, ?> p = hostlist.getProbeById(pid); if(p == null) { jrds.GraphNode node = hostlist.getGraphById(pid); if(node != null) p = node.getProbe(); } return p; }
@Override public boolean acceptGraph(GraphNode graph, String path) { Probe<?, ?> p = graph.getProbe(); if(p == null) return false; HostInfo host = p.getHost(); if(host == null) return false; Set<String> hostTags = graph.getProbe().getHost().getTags(); if(hostTags == null) { return false; } for(String oneTag: hostTags) { if(tag.equals(oneTag)) return true; } return false; }
/** * @param start the start to set */ public void setStart(Date start) { long step = getNode().getProbe().getStep(); this.start = new Date(org.rrd4j.core.Util.normalize(start.getTime() / 1000L, step) * 1000L); }
protected void setGraphDefData(RrdGraphDef graphDef, Probe<?, ?> defProbe, ExtractInfo ei, Map<String, ? extends Plottable> customData) { GraphDesc gd = getGraphDesc(); gd.fillGraphDef(graphDef, node.getProbe(), ei, customData); }
public String resolve(GraphNode graph) { return graph.getProbe().getHost().getName(); } },
protected void addlegend(RrdGraphDef graphDef) { Date lastUpdate = node.getProbe().getLastUpdate(); graphDef.comment("\\l"); graphDef.comment("\\l"); graphDef.comment("Last update: " + lastUpdateFormat.get().format(lastUpdate) + "\\L"); String unit = "SI"; if(!getGraphDesc().isSiUnit()) unit = "binary"; graphDef.comment("Unit type: " + unit + "\\r"); graphDef.comment("Period from " + lastUpdateFormat.get().format(start) + " to " + lastUpdateFormat.get().format(end) + "\\L"); graphDef.comment("Source type: " + node.getProbe().getSourceType() + "\\r"); }
protected void fillGraphDef(RrdGraphDef graphDef) { GraphDesc gd = getGraphDesc(); try { long startsec = getStartSec(); long endsec = getEndSec(); ExtractInfo ei = ExtractInfo.get().make(start, end); graphDef.setStartTime(startsec); graphDef.setEndTime(endsec); PlottableMap customData = node.getCustomData(); if(customData != null) { long step = Math.max((endsec - startsec) / gd.getWidth(), 1); customData.configure(startsec, endsec, step); } setGraphDefData(graphDef, node.getProbe(), ei, customData); if(gd.withLegend()) addlegend(graphDef); } catch (RuntimeException e) { Util.log(this, logger, Level.ERROR, e, "Impossible to create graph definition: %s", e.getMessage()); } }
private Sum doSum(JrdsDocument d, HostsList hl) throws Exception { HostInfo host = new HostInfo("SumHost"); SumBuilder sm = new SumBuilder(); sm.setPm(Tools.makePm(testFolder, "security=yes")); Sum sp = sm.makeSum(d); try { sp.configure(hl); } catch (Exception e) { } sp.getProbe().setHost(new HostStarter(host)); hl.addHost(host); hl.addProbe(sp.getProbe()); jrds.GraphNode mg = new MockGraph(); mg.getGraphDesc().add("plot"); hl.addHost(mg.getProbe().getHost()); hl.addProbe(mg.getProbe()); return sp; }