@Override public Map<String, Number> getLastValues(String host, String probeName) { Probe<?, ?> p = Configuration.get().getHostsList().getProbeByPath(host, probeName); return p.getLastValues(); }
private Configuration(Properties p) { propertiesManager.join(p); propertiesManager.importSystemProps(); propertiesManager.update(); hostsList = new HostsList(propertiesManager); }
static public GraphDesc getGd() { GraphDesc gd = new GraphDesc(); gd.add("sun", null, GraphDesc.LINE.toString(), "green", null, null, null, null, null, null, null); gd.add("shade", null, GraphDesc.LINE.toString(), "blue", null, null, null, null, null, null, null); gd.add("median", "sun,shade,+,2,/", GraphDesc.LINE.toString(), "magenta", null, null, null, null, null, null, null); gd.add("diff", "sun,shade,-,ABS,-1,*", GraphDesc.AREA.toString(), "yellow", null, null, null, null, null, null, null); gd.setGraphTitle("Temperatures in May 2003"); gd.setVerticalLabel("temperature"); return gd; }
@Override public int getProbesCount() { Configuration c = Configuration.get(); HostsList hl = c.getHostsList(); Collection<HostInfo> hosts = hl.getHosts(); int numProbes = 0; for(HostInfo h: hosts) { numProbes += h.getNumProbes(); } return numProbes; }
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; }
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 void add(String name, GraphType graphType) { add(name, name, null, graphType, Colors.resolveIndex(lastColor), name, DEFAULTCF, false, null, null, null); if(graphType.toPlot()) lastColor++; }
@Override public void run() { hostsList.stop(); if(hostsList.getRenderer() != null) hostsList.getRenderer().finish(); } };
public String getName() { if(name == null) { name = parseTemplate(gd.getGraphName()); } return name; }
public String getGraphTitle() { if(graphTitle == null) { graphTitle = parseTemplate(gd.getGraphTitle()); } return graphTitle; }
@Override String toString(Object o) { ConnectedProbe cp = (ConnectedProbe) o; return stringSignature(cp.getConnectionName()); } },
/** * Return the dimension calculated by the graph desc can (and should) be * overridden with custom graph classes * * @return the dimension of the graphic object */ public Dimension getDimension() { return getGraphDesc().getDimension(); }