简体   繁体   中英

Is there some way to browse erlang term storage (ETS)

I've got a small Elixir app that is using erlang term storage, and I'd like to browse it and see what's being stored. Is there some way to do that with either Elixir or Erlang?

I'd like to see how big it's getting and what's inside.

Edit: I know that I can look at the processes with :observer.start , but there isn't a process or application that is listed as ets . There is Elixir.Hex.Registry.ETS , but the state or other process information doesn't look like it's the right thing.

I can also print things out in iex however, that is not a great experience.

As mentioned previously, you can use Observer . To view ETS tables, click on Table Viewer tab, then select the table you need and with a right click you get the option to either view Table Info or Show Table Content .

To start the observer, run:

:observer.start

Screenshot:

这是截图

You can use the Observer application for that. It can display many different things, including the contents of ETS tables. Start it by typing in the Elixir shell:

:observer.start

Or in the Erlang shell:

observer:start().

For this to work, Erlang must have been built with the WX library.

There is some documentation in the Observer User's Guide . Also, this blog post describes how to use Observer to observe a remote Elixir node, which is advisable for production systems.

ets:i/1 is an interactive way to browse tables:

http://erlang.org/doc/man/ets.html#i-1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM