An experiment using Kibana to monitor Chrome browser performance as part of application testing.
It contains a dockerised version of Kibana 7.7.0 and a chrome browser extension that sends system cpu, browser performance data and websocket frequency data to Kibana.
The extension uses the chrome devtools-protocol to interact with the browsers debugger.
docker-compose upKibana can be accessed from http://localhost:5601/
Elastic can be accessed from http://localhost:9200/
curl -X POST -H 'Content-Type: application/json' -H 'kbn-xsrf: true' -d @./kibana/dashboard.json http://localhost:5601/api/kibana/dashboards/import
curl -X POST -H 'Content-Type: application/json' -H 'kbn-xsrf: true' -d @./kibana/browsers-dashboard.json http://localhost:5601/api/kibana/dashboards/importYou can save any dashboard changes using:
curl -X GET "localhost:5601/api/kibana/dashboards/export?dashboard=213c9c90-a764-11ea-a03d-a10b2b67390e" > your-dashboard.jsonThe chrome-extension must have permission to post to Kibana.
If you change Elastic to run on a specific host, you must update the permissions in the manifest.json.
Build the plugin (into dist in the chrome/extension folder):
cd chrome
yarn start Then:
- Vist
chrome://extensions/in your browser. - Toggle the
Developer modeswitch on the top right-hand-side. - Click the
Load unpackedbutton and and select thechrome/extensionfolder.
You should see the Kibana system pump (beat) extension:
Click the extension icon on when viewing the browser tab you want to monitor.
This will display a (very ugly) popup informing you that the extension has control of the debugger along with the data being sent.
You can change the browser name (the name is used to identify and filter the results in Kibana) and the Elastic Search URL (where the data is being sent) by double-clicking on the fields.
The Browser Performance dashboard can be accessed from http://localhost:5601/app/kibana#/dashboards
docker ps -aq -f status=exited~ list all your stopped containers usingdocker rm $(docker ps -aq -f status=exited)~ remove all your stopped containersdocker rm $(docker ps -a -q)~ remove all containersdocker volume ls~ view all volumesdocker volume prune~ remove unused volumes
http://localhost:9200/_cat/indices?v- see status, size doc-count of all indexes.curl -X DELETE http://localhost:9200/browser-cpu- remove cpu index

