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

Method getNodes

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

Calls 15

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
getMaxSessionCountMethod · 0.45