Rust mediasoup question

just a quick question here, was looking into the rust api’s i can’t seem to find getResourceUsage, is it me or is it not been implemented into rust yet

any help would be awesome

thanks advance

Jason

It will not be. That is only relevant to TypeScript because worker is a separate process, in Rust it is in a thread, you can use any generic Rust library to collect metrics of the whole process instead, but there is no easy way to separate particular worker’s CPU or RAM out of bigger application. I guess you can monitor CPU usage of a thread that worker runs on, but it is unlikely that you’ll be able to separate RAM usage.

1 Like

cheers for the quick answer, that really help

thanks again

Jason

any recommendation of crate to use for this purpose?

I used https://crates.io/crates/prometheus for metrics with great success, it has support for collecting process metrics like CPU and RAM usage on Linux.

1 Like

cool thanks for your help there @nazar-pc btw the rust mediasoup looks real good, nice work!

sorry i have one more question here, is there a way to grab the pid of a worker?

Worker has the same process ID as the rest of the app since it is just a thread in the same process.

cool cool cheers for the clearity

thanks again for the help

How can be identified what’s the less busy Worker, so new Router instances can be created on it?