zazi1991i / harviewer

Automatically exported from code.google.com/p/harviewer
0 stars 0 forks source link

Support display of multiple HAR files #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Support for displaying multiple HAR files instead of one.

Instead of generating a combined HAR file based on multiple separate HARs, 
accept multiple HAR/HARPs to display them.

Maybe load data asynchronously when person clicks on a vertical bar in page 
timeline.

My use case is to show data from ShowSlow - when HARs are collected over 
time: http://www.showslow.com/details/?url=http://www.sergeychernyshev.com/

Original issue reported on code.google.com by sergey.c...@gmail.com on 31 Mar 2010 at 2:34

GoogleCodeExporter commented 8 years ago
I am thinking about extending the path parameter for specifying array of URLs
(separated by '|'), something like as follows:

http://www.mydomain.com/har/viewer/index.php?path=examples/google.com.har|exampl
es/google.com.har|examples/inline-scripts-block.har

But there could be problems if one of the URLs already contains '|'

Which would load:
* examples/google.com.har
* examples/inline-scripts-block.har

All files would be loaded automatically (and asynchronously) step by step. Not 
sure
about the user click. The height of the vertical bar represents page load time, 
which
is not available till entire HAR file is loaded. But perhaps, a full-height
light-gray column could be displayed instead indicating that the info is not 
yet there.

Honza

Original comment by odva...@gmail.com on 5 May 2010 at 11:34

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
For URL parameters, I suggest just parsing multiple path params, e.g.
http://www.mydomain.com/har/viewer/?
inputUrl=http://www.showslow.com/details/har.php%3Fid%3D142%26callback%3DonInput
Data&inputUrl=http:/
/www.showslow.com/details/har.php%3Fid%3D84%26callback%3DonInputData&inputUrl=ht
tp://www.showslow.co
m/details/har.php%3Fid%3D83%26callback%3DonInputData

One thing is that URL can get quite huge so the alternative might be something 
like:
http://www.mydomain.com/har/viewer/?
baseUrl=http://www.showslow.com/details/&path=har.php%3Fid%3D142%26callback%3Don
InputData&path=har.p
hp%3Fid%3D84%26callback%3DonInputData&path=har.php%3Fid%3D83%26callback%3DonInpu
tData

Original comment by sergey.c...@gmail.com on 5 May 2010 at 12:32

GoogleCodeExporter commented 8 years ago
Vertical bars are a problem - ideally they should act as "preview" for the data.
Do you think there might be a way to hint the viewer about these numbers?
Is it just one parameter from each HAR?

I wonder if viewer freezes while data is being loaded (considering multiple 
huge files 
are getting parsed in the background).

Original comment by sergey.c...@gmail.com on 5 May 2010 at 12:44

GoogleCodeExporter commented 8 years ago
RE comment #3: I like both proposals.

RE comment #4: yes, it's just one parameter (log.page.pageTimings.onLoad). The 
only
way that occurs to me is to pass this number also within the URL. If the number
wouldn't be specified, the column will just get max height and its color could
indicate that the info is not yet available (till the HAR is really loaded).

As far as the freezing is concerned, there are three phases that can potentially
freeze the browser:

1) Loading the file (asynchronous XHR)
2) Parsing (usually quite fast)
3) UI rendering (HTML rendering is usually the slow part)

add #3) In case of more HAR files (or more pages in one HAR file) only one page 
is
actually expanded and the content rendered (e.g. all requests). So, only the 
vertical
bar (within the timeline) and one entry in the list (representing the page) 
must be
rendered for all the other pages. This is not much HTML (of course depends on 
number
of pages) so, could be fast.

I think that we need to test this to see whether the browser freezes or not. If 
yes,
we can execute the load upon user action (click on the vertical column) as you 
suggested.

Honza

Original comment by odva...@gmail.com on 7 May 2010 at 7:32

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Re: #c3 - we did this kind of integration with one of the widget vendors where 
a lot of URLs can be passed 
over and it seems that both versions make sense - simple one (with just 
repeated inputUrl for remote / path 
for local URLs) to have a few, possibly completely different URLs and the 
complex one (baseUrl + path) for 
cases with many URLs with the same base. You can go wild and have multiple 
baseUrls if you want to reset the 
base and then read a sequence of parameters from left to right ;)

Re: #c4 I agree - passing lt parameter right after inputUrl or path parameters 
might do that and if it's not 
there, then you just use grayed bar with maximum height. Here's the example of 
the URL:

http://www.mydomain.com/har/viewer/?
baseUrl=http://www.example.com/base/&path=1.har<=10&path=2.har&path=3.har&path=4
.har<=9

This will show bars height 10 for 1.har and height 9 for 4.har, both in dark 
grey, but will draw bars 10 
units heigh in light grey indicating that it's not final and use max size (10 
in this example). Once data is 
loaded, dark and light grey bars can become pink and will resize based on the 
HAR data (it's possible that 
HAR data for hinted bars was wrong so it's good time to adjust that).

Agree Re freezing - let's test first.

Original comment by sergey.c...@gmail.com on 7 May 2010 at 9:48

GoogleCodeExporter commented 8 years ago
I have a work around for this simply by putting the paths to the har file in an 
array and just loop through it, calling viewer.loadHar() for each path .. Works 
fine for me.

Original comment by bnguyen2...@gmail.com on 25 Aug 2014 at 4:03