{"id":13576504,"url":"https://github.com/erlanglab/erlangpl","last_synced_at":"2025-04-05T04:11:56.360Z","repository":{"id":17666047,"uuid":"82440295","full_name":"erlanglab/erlangpl","owner":"erlanglab","description":"Tool for developers working with systems running on the Erlang VM (BEAM). It helps with performance analysis.","archived":false,"fork":false,"pushed_at":"2021-12-29T17:45:40.000Z","size":2421,"stargazers_count":548,"open_issues_count":34,"forks_count":40,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-04-14T05:10:53.684Z","etag":null,"topics":["beam","elixir","elm","erlang","erlang-performance-lab","erlang-vm","performance-dashboard","performance-visualization","react","visualization"],"latest_commit_sha":null,"homepage":"http://www.erlang.pl/","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erlanglab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-19T06:31:05.000Z","updated_at":"2024-02-08T19:02:45.000Z","dependencies_parsed_at":"2022-08-30T04:20:20.904Z","dependency_job_id":null,"html_url":"https://github.com/erlanglab/erlangpl","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlanglab%2Ferlangpl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlanglab%2Ferlangpl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlanglab%2Ferlangpl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlanglab%2Ferlangpl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erlanglab","download_url":"https://codeload.github.com/erlanglab/erlangpl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284951,"owners_count":20913704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beam","elixir","elm","erlang","erlang-performance-lab","erlang-vm","performance-dashboard","performance-visualization","react","visualization"],"created_at":"2024-08-01T15:01:10.841Z","updated_at":"2025-04-05T04:11:56.335Z","avatar_url":"https://github.com/erlanglab.png","language":"Erlang","readme":"# Erlang Performance Lab [![Build Status](https://travis-ci.org/erlanglab/erlangpl.svg?branch=master)](https://travis-ci.org/erlanglab/erlangpl)\n\n\u003e Tool for developers working with systems running on the Erlang VM (BEAM). It helps with performance analysis.\n\n## Getting started\n\nThe Erlang Performance Lab tool (erlangpl for short) can be started using escript or as a regular Erlang release.\n\n### Quick start guide\n\n#### 1. Download the prebuilt `erlangpl` script from [here](https://github.com/erlanglab/erlangpl/releases/download/0.9.0/erlangpl.tar.gz) or type in the shell command:\n```\nwget https://github.com/erlanglab/erlangpl/releases/download/0.9.0/erlangpl.tar.gz\n```\n#### 2. Untar downloaded archive using any GUI program or type in the shell command:\n```\ntar -zxvf erlangpl.tar.gz\n```\n\n#### 3. Run the script\n```\n./erlangpl -n NODE_NAME -c COOKIE\n```\n\nTo make `erlangpl` work a few conditions must be met:\n\n* The node to be monitored must be run in the distributed mode\n(using `-name` or `-sname` flag). Click\n[here](http://erlang.org/doc/reference_manual/distributed.html#id88377) to learn\nmore.\n* Both the node's and the erlangpl's cookies must match. You can set the node's\ncookie by starting it with `-setcookie` flag. Keep in mind that when you do not\nset a cookie for the node it will be automatically set using `$HOME/.erlang.cookie`.\nSee the [official Erlang documentation](http://erlang.org/doc/reference_manual/distributed.html#id88604)\nto learn more.\n* The `erlangpl` script must run on OTP 19.3 or higher.\n\n##### Example \nIf the node you want to monitor is `a@127.0.0.1` and has a cookie set to\n`test` (`erl -name a@127.0.0.1 -setcookie test`) then you should run the script\nas follows:\n```\n./erlangpl -n a@127.0.0.1 -c test\n```\n\n#### 4. Visit http://localhost:37575\n\n### Download prebuilt script\n\nThe easiest way to get started is to download a prebuilt `erlangpl` script\n([download link](https://github.com/erlanglab/erlangpl/releases/download/0.9.0/erlangpl.tar.gz)).\n\n### Build it manually\n\n#### Prerequisites\n\nFor building UI you need to have following dependencies installed:\n* [node](https://nodejs.org/en/)\n* [yarn](https://yarnpkg.com/lang/en/)\n* [elm-lang](https://guide.elm-lang.org/install.html)\n\nBe aware that building UI can take some time. It takes around 1 minute on stock MacBook 2015 plus dependencies\ndownload for the first time. Second time dependencies will be cached.\n\n```\n$ git clone https://github.com/erlanglab/erlangpl.git\n$ cd erlangpl\n$ make release\n```\n\n## Running erlangpl script\n\nThe erlangpl shell script is a self-contained escript, which can be started from a command line as long as you have Erlang/OTP installed.\n\n```\n$ ./erlangpl -h\n\nUsage: erlangpl [-n \u003cnode\u003e] [-c \u003ccookie\u003e] [-p \u003cplugin\u003e] [-h]\n                [-v \u003cverbose\u003e] [-P \u003cport\u003e] [-V] [-s \u003csname\u003e] [-l \u003cname\u003e]\n\n  -n, --node     Monitored node name\n  -c, --cookie   Overwrite ~/.erlang.cookie\n  -p, --plugin   Path to plugins\n  -h, --help     Show the program options\n  -v, --verbose  Verbosity level (-v, -vv, -vvv)\n  -P, --port     HTTP and WS port number\n  -V, --version  Show version information\n  -s, --sname    Start with a shortname\n  -l, --name     Start with a longname, default erlangpl@127.0.0.1\n\n$ ./erlangpl -n testnode@127.0.0.1 -c YOURCOOKIE\n```\n\nOnce started, try visiting http://localhost:37575/\n\n## Examples\n\n### Connecting to an Elixir iex session\n\n```\n$ iex --name foo@127.0.0.1 -S mix\n```\n\n```\n$ ./erlangpl --node foo@127.0.0.1\n```\n\n### Mnesia cluster\nYou can generate messages between nodes by querying a distributed database Mnesia.\n\nTo setup a Mnesia cluster, start several Erlang nodes with unique names e.g. `a@`, `b@`, `c@`, etc. and start the database on all of them:\n```\nerl -name a@127.0.0.1\n(a@127.0.0.1)1\u003e mnesia:start().\n```\nThen create a `test_table` and configure it to be replicated on all nodes:\n```\n(a@127.0.0.1)2\u003e mnesia:change_config(extra_db_nodes, ['b@127.0.0.1']).\n(a@127.0.0.1)3\u003e mnesia:change_config(extra_db_nodes, ['c@127.0.0.1']).\n(a@127.0.0.1)4\u003e mnesia:change_config(extra_db_nodes, ['d@127.0.0.1']).\n(a@127.0.0.1)5\u003e mnesia:create_table(test_table, []).\n(a@127.0.0.1)6\u003e [mnesia:add_table_copy(test_table, Node, ram_copies) || Node \u003c- nodes()].\n```\n\nHere are some behaviours you can test:\n```\n[begin mnesia:transaction(fun() -\u003e mnesia:write({test_table, Key, \"value\"}) end), timer:sleep(10) end || Key \u003c- lists:seq(1,2000)].\n[begin mnesia:sync_dirty(fun() -\u003e mnesia:write({test_table, Key, \"value\"}) end), timer:sleep(10) end || Key \u003c- lists:seq(1,2000)].\n[begin mnesia:dirty_write({test_table, Key, \"value\"}), timer:sleep(10) end || Key \u003c- lists:seq(1,2000)].\n```\n\nVideos from those experiments were posted on [YouTube](https://www.youtube.com/channel/UCGkcbu799cC1rtMaQtAajpg)\n\n## Developing\n\n### Erlang\n#### Running development release\n\nYou can also start the tool as a regular Erlang release and connect to its console to debug the tool itself.\n\n```\n$ make\n$ rebar -f generate\n$ ./rel/erlangpl/bin/erlangpl console node=testnode@127.0.0.1 cookie=YOURCOOKIE\n```\n\n### User Interface\n\n#### Running standalone\n\n`erlangpl-ui` can be started standalone using Node with npm or yarn.\nWe are recomending [yarn](https://yarnpkg.com/lang/en/) for that.\n\n```shell\nyarn \u0026\u0026 yarn start\n```\n\nNow, application can be found at `localhost:3000` and will be listening for messages from `localhost:37575` where you have to have [erlangpl](https://github.com/erlanglab/erlangpl) running.\n\n#### Writing Elm code\n\nAlthough `erlangpl-ui` is written in React we belive in Elm's power. Because of that we support Elm in our build process.\nThis is possible because of [react-elm-components](https://github.com/evancz/react-elm-components) and [elm-webpack](https://github.com/elm-community/elm-webpack-loader).\n\nYou can write any separate component in Elm and then wrap it into React component which can be integrated with whole application. Elm code should be placed in `ui/src/elm` and every component whould have main file in this directory and all files related to this component in directory with the same name. React wrapper file should have the same name as Elm component and `flow` should be disabled for this file.\n\n```elm\n-- ui/src/elm/About.elm\n\nmodule About exposing (..)\n\nimport Html exposing (text)\n\nmain =\n    text \"Hello world from Elm component\"\n```\n\n\n```javascript\n// ui/src/about/components/About.js\n\nimport React from 'react';\nimport Elm from 'react-elm-components';\nimport { About } from '../../elm/About.elm';\n\nimport './About.css';\n\nconst AboutWrapper = () =\u003e {\n  return (\n    \u003cElm src={About} /\u003e\n  );\n};\n\nexport default AboutWrapper;\n```\n\nHave fun!\n","funding_links":[],"categories":["Erlang","Erlang Specific"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferlanglab%2Ferlangpl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferlanglab%2Ferlangpl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferlanglab%2Ferlangpl/lists"}