This article is the second day article of Selenium / Appium Advent Calendar 2017.
Hello! Are you watching! !! Have you been! !! !! Please forgive me for leaving it for 2 months without anyone noticing that the server was down! !! !! !!
When a new version of Selenium is released, I try to check the updated contents for the time being, but the updated contents of the Java part of Selenium 3.8.0 have new items and it is eye-catching. It was.
https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG
* Added initial support for managing Grid Hubs and Nodes via JMX
What about JMX? ?? ??
Who gets it! ?? Looking at the issue on GitHub, it seems that the story was occasionally raised ...
It is a public standard about how to manage various states of Java applications. You use SNMP to manage the state of your server, right? That's how JMX is used to manage the state of Java apps.
What information can you see at this point? Let's try it as much as you can easily.
In this article, I'll give you as good a system property as possible as a label to help you identify the role later.
$ java -D roll cake=Koyama roll\
-jar selenium-server-standalone-3.8.0.jar \
-role hub
$ java -D roll cake=Dojima roll\
-jar selenium-server-standalone-3.8.0.jar \
-role node
It will be easier to understand if you add the l
option and the v
option.
$ jps -lv
32999 selenium-server-standalone-3.8.0.jar -D roll cake=Koyama roll
33001 selenium-server-standalone-3.8.0.jar -D roll cake=Dojima roll
Found. Looks delicious.
Let's start with the hub process. The label is Koyama Roll. In addition, Koyama Roll is said to be a moist and delicate sponge made by whipping plenty of honey and egg yolk and slowly baking the dough that carefully embraced the air. [^ 1]
$ jconsole 32999
I'm told something, but this time I just want to check it, so I don't care too much and proceed with "unprotected connection".
The jconsole screen is displayed. Click on the tab "MBeans".
On the left side of the MBeans tab is a list of what you can monitor. ʻOrg.selenium.grid` is the new part of Selenium 3.8.0. Let's take a look at the contents.
Oh, there are many things that seem like that ~ "Hub" is the information of the hub itself, and "Remote Proxy" is the information of the connected node.
There has been an API for acquiring all items for a long time, but I think that the threshold has been lowered because acquisition via JMX has become possible as standard. If you use it in combination with a monitoring tool that can use JMX such as ZABBIX, it seems that you can operate Selenium Grid in a different way.
Next, let's look at the process of the node. The label is Dojima Roll. In addition, Dojima Roll is a custom-made cream made by carefully selecting several types of raw milk from Hokkaido and finishing it with a unique manufacturing method that is unique in the world, and it seems that it has a fresh taste like freshly squeezed milk. [^ 2]
$ jconsole 33001
Oh? You can't see anything here. JMX support seems to be designed so that if you monitor the hub, you can see everything, including the nodes.
Next time ... someone! Someone come! !! !! Selenium / Appium Advent Calendar 2017 is still waiting for your challenge!