jonasmr / microprofile

microprofile is an embeddable profiler
MIT License
1.46k stars 115 forks source link

Any short but complete examples? #61

Open bobinspace opened 4 years ago

bobinspace commented 4 years ago

Hi, it's not very clear for beginners how to use this library. Is there a short and complete example that explains how to use it in actual code, where the instrumentation data is written, how to query/view that data, and how to view these data live in Live View?

From the Readme, it's not so clear how to accomplish most of that.

I get some idea that MICROPROFILE_SCOPEI is for instrumenting a function scope. But where does the instrumentation data reside, and how do I view it? Also, it says to call MicroProfileFlip(nullptr); - what does it do? And then, MICROPROFILE_TIMELINE_ENTER/LEAVE_STATIC seems to be something that tracks entry/exit points, likely something that can add some data points to the timeline (guessing by the names?), but when I open Live View, I don't see anything.

jonasmr commented 2 years ago

Its explained under live view:

https://github.com/jonasmr/microprofile#live-view

you open the browser and point it to the ip address of where you are running the profiled application: IE localhost:1338 if you're running it locally.

You are right the documentation could be better