Repository navigation
Measurement UI - #894
Measurement UI#894karussell wants to merge 2 commits into
Conversation
|
Some comments:
Couple of asides:
|
What do you mean here? You can start the server in the GH root and open measurement.html with the browser directly (no server). Then it should just work
Sure, go ahead for something better ;)
You don't need a server if you put the stats in the app itself like with a swing UI. But if you want to display the stats in the browser you cannot load files from local storage so you need to serve them. Maybe instead of the web server and properties overhead we could visualize the data via a Swing UI directly via freechart like here.
That is what we already do here, but travis is not an option as you always run on different machines with different loads.
That is indeed a problem. But I think if the measurement class stabilizes we could avoid that.
The advantage is that you can compare many commits for historic purposes.
Why do you think so? If you run the measurement roughly at the time of the commit I think this is useful.
It is improvable, sure. But not the worst. There are integration tests which we can run directly from the repo, but we need the full pbf. Also it will get 'worse' when we include gtfs files. Interesting problem :) |
I do not understand how this would be an improvement. We already use npm and now we would require a third tool 'python'. I know it is pre-installed on linux&ios but not on windows. |
|
Hmmm - can you clarify the objective of the measurement suite? I see two specific use cases
I've been focusing on the former - can you clarify?
Say I'm on a server, and I run the measurements and then
Fair point! At this stage, it depends on the objective - if it's 'for the developer', then the UI is probably not even required.
Maybe I'm misunderstanding, but I load local files all the time. I do this explicitly at work so non-technical users don't have to e.g. spin up a server to use a web app. That said, there can be some problems with different browsers - off the top of my head Firefox/IE/Safari support it, and Chrome does too (if you allow it). That said, this is only useful in the 'for the developer' case - you wouldn't want to be using it in a production historical tracking app!
Ah, nifty. By 'single instance' I should have said 'single dedicated server'. You can get round the different machine issue (but not different load issue) by rerunning the tests for the entire history, on every single commit. Or just have a dedicated server.
Can't you do that with both approaches?
That's effectively limiting yourself to things which can only be done with the stabilized class ... "we'd like to do X, but we'd lose all of our historic measurements, so we won't". That said, the converse is how you'd test GH separately - if the core is refactored and method X becomes method Y, how would a separate measurement suite know to change from calling X to calling Y? So, maybe not so simple. However, it depends on what the objective is.
Assuming the 'for the developer' use case, then I might get it to run with the last 10 commits. If each commit takes about 1 minute to test, then I'll see a graph with an x range of 11 minutes ... despite the actual commits being days or weeks apart. And, if I'd already run it before (on multiple branches) I might get completely bonkers results. What I'd suggest is
Two thoughts:
I'm not sure what you mean by 'put[ting] the stats in the app itself' - as far as I can see, there has to be measurement data stored somewhere (currently txt files, maybe database as above, etc.), or returned dynamically (as per my comment about a separate repo/tool for evaluating performance).
Usually, for something simple (or non-standard), I take the approach of only including source code in git, and having e.g. a 'setup.sh' script which gets all my dependencies first. (This is especially valid for data, e.g. GTFS feeds - though dat is maybe going to change that.) However, most tools already do this for you (e.g. maven, npm, etc.).
You could simply have a (As a side thought - while some resources are available online anyway, you could always create a 'graphhopper-resources' repo, in which you put the data, and that way you can pull individual files - possibly from rawgit - of the correct version) only when you need them. And the main git repo stays fast and snappy and easier to use (e.g. diffs only display code diffs, not data diffs).
Did you quote the wrong selection? By using local files (as you quoted), there's no need for npm or node or python, and is the most portable solution of all. |
I would like to have one tool for both. Or why do you think we need two solutions?
To access localhost or whatever host can be made configurable, e.g. via URL parameter or serving the measurement.html also via the server.
Tracking changes over time also is important to find issues when merging branches etc. It is 'perf testing' like we do unit and integration tests.
You mean GH repo is hard to use? I never ever had a performance problem to be honest even with my slow connection. The initial clone takes a bit, true. But afterwards it is fine. Also I do not understand how the separate repos make something better: at some point you need to keep those repos in-sync. What if you switch the branch etc? I think it is not that easy :)
Which is the most portable solution? Loading the files and put it in a java visualization? I agree but I think html&js is better because then you can use the UI also for the second purpose.
What I meant is to run the measurement suite and create some in-memory data (or load local measurement files) and display it directly in Java (like with jfreechart)
Do you mean I need to click a button and select the files I want? I would like to have something simpler where I just open the file or refresh the site to see updates and that is only possible when serving the measurements files via a server if you want to go with html+js and a standard browser IMO. If not, I'm happy to learn stuff :) !
👍
I'm not a big fan of databases :) also I do not see how this is not possible with properties files - using defaults if something is missing is easy there too. But again: I just did what suited my needs and I was hoping it could solve not only the historic tracking problem (2) but also the commit comparison problem (1). And also: I'm open towards something more powerful. |
We just have to be careful. E.g. for historical tracking, we'll have millions of measurements, and databases make sense. For local stuff, users don't want to have to fluff round with installing databases, etc., so simple approaches (as currently) make sense. I'll have a think.
Definitely agree.
Not exactly. However, it's good practice to separate the code that does stuff from dependencies (e.g. other code, or data the code can use). For me, the main reason is to make it clear to the developer what is and what isn't the relevant code (and changes). For example, if I want to see what you've changed with this PR, if I do a
To be clear, I'm merely talking about a separate repo as a convenient way of hosting/versioning source data. In other words, a data dump. For example, we currently have this file in the
Cool, that's what I meant too.
Learning time = ) Whack this into an index.html, then open with Firefox. Console should display an error. Now create a file next to index.html called 'measurements.txt' and add some content. Reload, and the console should show the content. Note:
I'll have a think, but at this stage, I consider other stuff more important (inc. map matching), so will probably work on that. |
Thanks & works perfectly!
I only have the dev in mind. Who else should be interested in this?
That won't happen I think. Because this makes everything more complex and I do not see any benefits. If you download the git repo and you want to contribute you need to run the tests so you need to download the data. I do not see a problem with the current approach nor an advantage with the proposed one. Using npm instead of putting the js files in the repo is of course something we should do. Furthermore when I picked the pbfs and osm files I took care that this is only as few as possible coverage and I could reuse old areas for new cases. |
Sorry, I was more meaning that the dev is only likely to use this for a few measurements, so it suits. (And it's easy for them to understand/develop it.) However, if you want a history server with thousands of measurements, I don't think this will suit - partly as you'll be doing thousands of HTTP requests (though I guess you could dynamically fetch them depending on the amount of history they want to view), but also because I think loading local files like this is generally frowned upon for production stuff.
That's fine with me.
Great. Once the deliverable has stabilised (i.e. we know we're not doing a Java swing GUI or some such) I can help with this part if you want. |
OK, my current thoughts are thus:
Currently I'm leaning toward probably keeping the measurement stuff in this repo, and just running the measurement suite for e.g. the last 10 commits, as part of Travis. If we can easily use e.g. openbenchmarking, then great - otherwise I'm less inclined to worry about historical tracking (for now). Thoughts @karussell? |
With this simple measurement.html you can evaluate output from
./graphhopper.sh measurement your.pbfRelated graphhopper/map-matching#73