@Override public int hashCode() { final int PRIME = 31; int result = 1; result = PRIME * result + end.hashCode(); result = PRIME * result + start.hashCode(); long temp; temp = Double.doubleToLongBits(max); result = PRIME * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(min); result = PRIME * result + (int) (temp ^ (temp >>> 32)); result = PRIME * result + ((node == null) ? 0 : node.hashCode()); return result; }
Element graph = (Element) graphs.appendChild(document.createElement("graphname")); graph.setTextContent(qualifiedGraphName); graph.setAttribute("id", String.valueOf(gn.hashCode()));
public void addGraphs(Collection<GraphNode> graphs) { for(GraphNode currGraph: graphs) { LinkedList<String> path; path = currGraph.getTreePathByHost(); getGraphTreeByHost().addGraphByPath(path, currGraph); path = currGraph.getTreePathByView(); getGraphTreeByView().addGraphByPath(path, currGraph); graphMap.put(currGraph.hashCode(), currGraph); } }
private void doGraph(GraphNode gn, Renderer r, ParamsBean params, JrdsJSONWriter w) throws IOException { jrds.Graph graph = gn.getGraph(); if (graph == null) { return; } params.configureGraph(graph); Map<String, Object> imgProps = new HashMap<String, Object>(); r.render(graph); Probe<?, ?> p = gn.getProbe(); imgProps.put("probename", p.getName()); imgProps.put("qualifiedname", graph.getQualifiedName()); Dimension d = graph.getDimension(); if(d != null) { imgProps.put("height", d.height); imgProps.put("width", d.width); } imgProps.put("graph", params.doArgsMap(graph, true)); imgProps.put("history", params.doArgsMap(graph, false)); imgProps.put("probe", params.doArgsMap(p, true)); imgProps.put("graphnode", params.doArgsMap(gn, true)); doTree(w, graph.getQualifiedName(), gn.hashCode(), "graph", null, imgProps); }
if(f.acceptGraph(child, gt.getPath() + "/" + child.getName())) { hasChild = true; String graphid = base + "." + child.hashCode(); childsref.add(graphid); doTree(w, leafName, graphid, "graph", null);
@Test public void testCustomGraph() throws IOException { PropertiesManager pm = Tools.makePm(testFolder); pm.setProperty("tabs", "filtertab"); pm.update(); HostsList hl = new HostsList(pm); GraphDesc gd = new GraphDesc(); gd.setName("truc"); gd.setGraphTitle("title"); Map<String, GraphDesc> gdmap = new HashMap<String, GraphDesc>(); gdmap.put(gd.getName(), gd); Set<Tab> tabs = new HashSet<Tab>(); Map<Integer, GraphNode> graphMap = new HashMap<Integer, GraphNode>(); Map<String, GraphTree> graphTrees = new HashMap<String, GraphTree>(); hl.doCustomGraphs(gdmap, graphMap, graphTrees, tabs); hl.addGraphs(graphMap.values()); boolean found = false; GraphNode node = null; for(Tab t: tabs) { if(PropertiesManager.CUSTOMGRAPHTAB.equals(t.id)) { found = true; t.setHostlist(hl); node = t.getGraphTree().enumerateChildsGraph().get(0); } } Assert.assertNotNull(graphMap.get(node.hashCode())); Assert.assertTrue(found); Assert.assertNotEquals(graphTrees.size(), 0); } }