micmro / PerfCascade

Responsive, SVG based HAR waterfall viewer
https://micmro.github.io/PerfCascade
MIT License
276 stars 51 forks source link

Add Json format to other format #256

Closed surya0014 closed 5 years ago

surya0014 commented 5 years ago

Thanks for your support and work. I have added fromJson method in main( inside ts) and created Json parser "myJson" (inside ts/transformer) . I request you to add these feature in PerfCascade and it will be useful to others .Thanks

micmro commented 5 years ago

Hi @surya0014 , thank you for your interest in PerfCascade. Sorry, but I am not quite clear what exact type of JSON this handles? Can you also please provide some examples how this can helps others? Thank you!

surya0014 commented 5 years ago

For Example inside Har files we just have a json data in below format : { "log": { "version": "1.2", "pages": [], "entries": [] } } Instead of manually uploading har files, many user want to store and use it in perf-cascade. The size of storing Har files and Zip files are high when compare to Json ,So we can just store Json ( above Json ) taken from har files . So I have added fromJson method in main( inside ts) and parser "myJson" (inside ts/transformer) and now just pass Json data extracted from har and pass it to method ,it works on perf-cascade. I hope this change will be useful to many .

micmro commented 5 years ago

Sorry I might understand you wrong, but isn't a .har file just a json file with exactly the same format?

surya0014 commented 5 years ago

we need not even use .har or .json file,we can directly use json format obtained from har file as json object and use json object in perfCascade Storing Json object takes less size when compare to storing file and use json object to pass into "fromJson" method.

soulgalore commented 5 years ago

I don't fully get it either. Can you explain it some more @surya0014 ? Can you show a concrete use case, maybe there's another way of fixing what you need?

surya0014 commented 5 years ago

My requirement is to pass json object to perf-cascade method instead of files . fromHar() method does not accept json object . So i added a separate method called as "fromJson()" to accept my json object. If separate method is not added to perfCascade atleast remove type specified in fromHar() and make it to accept all other formats . Eg : In main.ts inside ( src/ts )