MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / getNodes

Method getNodes

java/src/org/openqa/selenium/grid/graphql/Grid.java:71–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69 }
70
71 public List<Node> getNodes() {
72 return distributorStatus.getNodes().stream()
73 .map((NodeStatus status) -> {
74 Map<Capabilities, Integer> stereotypes = new HashMap<>();
75 Map<org.openqa.selenium.grid.data.Session, Slot> sessions = new HashMap<>();
76
77 for (Slot slot : status.getSlots()) {
78 org.openqa.selenium.grid.data.Session session = slot.getSession();
79 if (session != null) {
80 sessions.put(session, slot);
81 }
82
83 int count = stereotypes.getOrDefault(slot.getStereotype(), 0);
84 count++;
85 stereotypes.put(slot.getStereotype(), count);
86 }
87
88 OsInfo osInfo =
89 new OsInfo(
90 status.getOsInfo().get("arch"),
91 status.getOsInfo().get("name"),
92 status.getOsInfo().get("version"));
93
94 return new Node(
95 status.getNodeId(),
96 status.getExternalUri(),
97 status.getAvailability(),
98 status.getMaxSessionCount(),
99 status.getSessionTimeout(),
100 status.getSlots().size(),
101 stereotypes,
102 sessions,
103 status.getVersion(),
104 osInfo);
105 })
106 .collect(toUnmodifiableList());
107 }
108
109 public int getNodeCount() {
110 return distributorStatus.getNodes().size();

Calls 15

collectMethod · 0.80
getSlotsMethod · 0.80
putMethod · 0.65
getStereotypeMethod · 0.65
getMethod · 0.65
mapMethod · 0.45
streamMethod · 0.45
getSessionMethod · 0.45
getOsInfoMethod · 0.45
getNodeIdMethod · 0.45
getExternalUriMethod · 0.45
getAvailabilityMethod · 0.45