protected GraphDesc getGraphDesc() { return node.getGraphDesc(); }
@Override public void addGraph(GraphNode node) { super.addGraph(new RRDToolGraphNode(this, node.getGraphDesc(), rrdpath)); }
private double parseRangeArg(String rangeArg, Graph g) { if(rangeArg == null) return Double.NaN; Matcher m = rangePattern.matcher(rangeArg); jrds.GraphNode node = g.getNode(); if(m.matches() && node != null) { String valueString = m.group(1); Number value = jrds.Util.parseStringNumber(valueString, Double.NaN); String suffixString = m.group(3); if(!"".equals(suffixString)) { try { SiPrefix suffix = SiPrefix.valueOf(suffixString); return suffix.evaluate(value.doubleValue(), node.getGraphDesc().isSiUnit()); } catch (java.lang.IllegalArgumentException e) { logger.info("Illegal SI suffix " + suffixString); } } else return value.doubleValue(); } return Double.NaN; }
return; GraphDesc gd = graph.getNode().getGraphDesc();
message = String.format("Error rendering graph %s: %s", graphName, e.getMessage()); } catch (Exception e1) { String graphName = graph.getNode().getProbe().getName() + "/" + graph.getNode().getGraphDesc().getGraphName(); message = String.format("Error rendering incomplete graph %s: %s", graphName, e.getMessage());
public void configure(HostsList hl) { super.configure(hl); this.hl = hl; GraphNode g = null; // Check the sum consistency for(String graphname: graphList) { g = hl.getGraphById(graphname.hashCode()); if(g == null) { logger.warn(Util.delayedFormatString("graph %s not found for sum '%s'", graphname, getName())); } } // The last graph found is used to clone the graphdesc and use it if(g != null) { try { GraphDesc oldgd = g.getGraphDesc(); GraphDesc newgd = (GraphDesc) oldgd.clone(); newgd.setGraphTitle(getName()); setGraphDesc(newgd); logger.debug(Util.delayedFormatString("Adding sum called %s", getQualifiedName())); } catch (CloneNotSupportedException e) { throw new RuntimeException(String.format("GraphDesc is supposed to be clonnable, what happened with %s ?", getName())); } } else { throw new RuntimeException(String.format("Not graph found in %s definition, unusable sum", getName())); } }
int wh = graph.getDimension().height; int rh = graph.getRrdGraph().getRrdGraphInfo().getHeight(); logger.trace("Delta height:" + (rh - wh) + " for " + node.getGraphDesc()); Date finish = new Date(); long duration1 = middle.getTime() - start.getTime();
GraphTree gt = hostsList.getGraphTreeByHost(); for (GraphNode gn: gt.enumerateChildsGraph()) { GraphDesc gd = gn.getGraphDesc(); List<String> path = gd.getViewTree(gn);
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; }