nagisa / rust_tracy_client

Tracy client libraries for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change the client port

kbleeke opened this issue · comments

Hi

Is is possible to change the client port that the server connects to?

For Context:
I am testing a replicated system on localhost. I have multiple instances of the same binary. The tracy cli seems to select one of them at random to capture the profile. I would like to choose one replica myself instead by having all of them listen on different ports.

My understanding is that by including this crate is it automatically enabled at compile time. It would be kind of inconvenient to produce different binaries.

I had a brief look at all three crates but I couldn't find an exposed setting. Happy to submit a PR with some guidance.

Thanks

Refer to the upstream docs:

2.1.7 Changing network port
[...]
The data connection port may be also changed without recompiling the client application,
by setting the TRACY_PORT environment variable.

It's also stated that multiple instances will choose different ports by default, so you could use OS-level tools to identify which process is listening on which port.

Yeah, as far as I know there is no way to change the port besides the environment variable, and I don't believe the client libraries will add an API to do so in the future.

Thanks, I didn't see it in the docs. This is enough to cover my situation