Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ID for Timeline #55

Open
ftanuma opened this issue Sep 24, 2019 · 5 comments
Open

ID for Timeline #55

ftanuma opened this issue Sep 24, 2019 · 5 comments

Comments

@ftanuma
Copy link

ftanuma commented Sep 24, 2019

Hi,

It would be great if I can use multiple timelines from the same thread, and distinguish when the data is converted to .httrace and see it on Chrome tracing tool.

It looks that event->thread_id is used to map a timeline to a tid in httrace, but for this use case, we probably need ID for timeline itself and use it for tid.

Thanks!

@loganek
Copy link
Member

loganek commented Nov 9, 2019

Hi @ftanuma
Adding identifier for a timeline would require some architectural changes which I'd like to avoid 0.x major version. I might consider that change for HawkTracer v1.x (not sure though), but for now, we could provide a feature for merging streams in the converter with labels, so each of your timeline (within one thread) could have different listeners and stream tracepoints e.g. to different files, so you can then merge them into single httrace file.
Would this solution be enough for now? I know this is sounds like workaround, but I'd like to quickly satisfy your requirements before we implement the feature properly (I'm not sure yet whether the solution would be to add timeline id to event, or something different)

@ftanuma
Copy link
Author

ftanuma commented Nov 13, 2019

Hi @loganek,

Yes. merging multiple trace files offline is a reasonable option :)
Thank you for considering!

@nullpointerderef
Copy link

Hi @loganek,

I have been trying to find the option to merge multiple trace files offline by using the converter. Is that feature already available?
Thanks in advance

@loganek
Copy link
Member

loganek commented Mar 23, 2020

@osvillalon sorry for late reply. Unfortunately the feature is not available yet. I'll try to work on that over the upcoming weekend.

@loganek
Copy link
Member

loganek commented May 10, 2020

@osvillalon @ftanuma sorry it took me soo long to look into that. I've prototyped a first version of merging multiple streams into one in the loganek/multi-stream-client branch. The basic usage is:

./client/hawktracer-converter --source multi_dump_1.htdump,multi_dump_2.htdump  --output out.json  --source-id dump1,dump2 --source-offset -1200,1500

As you can see, there are 3 changes:

  • source parameter takes a coma-separated list of streams (in this case, 2 files: multi_dump_1.htdump and multi_dump_2.htdump, but it could also be two or more TCP streams, or one TCP stream and one file stream etc.)
  • source-id parameter has been added - this is just a list of labels for your streams. It's optional, and by default will generate names like source_1, source_2 etc.
  • source-offset parameter has been added - this is needed in case you merge streams from distributed systems, and want to synchronize timestamps. If you run two streams within the same process, you can set it to zero (or not specify this parameter at all, since it's 0 by default).

The feature has been implemented using processes. See picture below:
multi-streams

For now I only tested it with file streams, and I'm sure there'll be some problems with TCP, but wanted to get back to you with some prototype so I can get feedback from you about user interface.
The code also requires a lot of refactoring.

As I said, any feedback is very welcome, as I'm still experimenting with this feature.
Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants