Comments (6)
Very good idea! 👍
I'd not to do the fork of the UI, but rather the UI mode (which can be enabled / disabled).
My proposal is to do the following:
UI
We can introduce a small icon, representing detected language - by default it will be Erlang and in that way we will define filtering. When we detect Elixir (see below how) we can switch to different mode. This icon will be a button which will be able to switch if you want to use Erlang syntax in Elixir.
IMHO this make sense, because effectively Elixir apps runs inside the Erlang environment.
Detection
It is relatively easy, because we can sniff applications or MFA available to trace (which we're listing). Ideally you could sniff application elixir
or search for Elixir specific modules like 'Elixir.Enum'
.
Transformation
That is an open discussion which I want to start - we can do it either on front-end or back-end. I'm voting for first one, I'd try to argument why:
- This enables switching and makes it much easier, because it will not introduce any state on the back-end, this will be a purely client-side option.
- One feature of
xprof
which is nice is sharing the same UI / view with others that will open app e.g. remotely - question is do we want to share the mode too - if no, there is no other way of doing it than client-side.
from xprof.
I feel convinced to doing this on the UI side. I think, the mode won't be switched very frequently, at least I can't see why would I want to do this on the daily basis. You have my axe!
from xprof.
I would argue for the server side (I've taken steps in #16 to remove erlang function syntax specific regexes from the UI)
- I think mode would be rarely switched (an elixir node/application would be xprof-ed in elixir mode, a purely erlang node/application in erlang mode)
- it would be much easier to do any kind of parsing or more complex logic on the server side (where erlang and elixir parsers/formatters can be used directly)
- it is almost impossible to format terms in either erlang or elixir syntax in the UI (captured args/res)
what are the erlang/elixir specific components and how they could be handled by UI to be mode agnostic:
- function browser textbox ("api/start_mon" endpoint - just a single query string)
- function browser drop-down auto-complete list items ("api/funs" endpoint - server could returns list of strings instead of list of [m, f, a])
- id/label of monitored mfas ("api/mon_get_all" and "api/stop_mon" endpoints - again id/label could be pretty printed string instead of [m, f, a])
- args and res of captured data ("api/caputre_data" endpoint - terms could be formatted accoring to mode in the backed)
drawbacks of server side implementation:
- switching between modes requires re-requesting certain components (not a huge issue)
- it would require state in the server to have different UI's for the same server with different modes
- it could be sometimes desirable to have erlang mode on an elixir node (is this a real need?) in that case mode based on auto-detection is not enough
from xprof.
It looks like you've convinced me, @gomoripeti. 😉
It makes more sense now for me to have it on back-end, even if we need to introduce state on the server. Especially part with having on back-end side parsers / engines.
It looks like you have full plan for it and it is related with your work on match specifications - will you be able to tackle this one too?
from xprof.
😄 I think we have a decision now
There are multiple steps: (and I could probably do with some help )
- convert endpoints to be mode agnostic
- mode detector and/or switch
- Elixir parser for auto-complete and mod.fun/arity tracing
- Elixir parser for match-spec funs (this needs some investigation what should be the syntax, what other tools use)
- Elixir formatter for terms
- Update Readme
- Run elixir tests on travis (nice-to-have)
from xprof.
Great @gomoripeti, this looks complete for me.
For 3rd task please keep in mind that in Elixir you can call Erlang modules with :atom.fun/arity
, so colon need to be included in module name.
from xprof.
Related Issues (20)
- Argument distribution
- Extend query syntax
- Run elixir tests properly on travis
- Save favourite queries
- Generate docs for hexpm HOT 1
- Return-value matching
- Graph layout HOT 1
- How to specify a different port? HOT 2
- Create Erlang NIF tracer
- To meta-trace or not to meta-trace
- Change styling of Edoc documentation HOT 1
- json encoding crashes on some lists HOT 1
- Removing noise from build files in git status HOT 1
- Cannot compile using Erlang 21. HOT 5
- Line graph with configurable lines HOT 2
- Browser history of captured calls
- API_HOSTNAME hardcoded to localhost HOT 1
- How to specify listen address HOT 3
- Update cowboy to newer version (2.X) HOT 2
- Improve auto-complete and unloaded modules
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xprof.