rs-metrics-process icon indicating copy to clipboard operation
rs-metrics-process copied to clipboard

Please support FreeBSD

Open yurivict opened this issue 1 year ago • 5 comments

There's no freebsd.rs

The Reth project can't be compiled on FreeBSD because of this problem. https://github.com/paradigmxyz/reth/issues/5918

yurivict avatar Jan 02 '24 17:01 yurivict

I know little to nothing about freebsd or how to get the metrics values on that OS:

https://github.com/lambdalisue/rs-metrics-process/blob/dbb1d752e0b497d32853a6c7b3acd77d6f64157d/src/collector/linux.rs#L10

maybe via https://github.com/johalun/sysctl-rs and/or https://github.com/fubarnetes/rctl

but perhaps there can be collect that returns an empty Metrics for freebsd so that it at least compiles on freebsd?

mattsse avatar Jan 02 '24 19:01 mattsse

I've no idea about FreeBSD so I cannot implement it by myself. PR is welcome.

but perhaps there can be collect that returns an empty Metrics for freebsd so that it at least compiles on freebsd?

Not sure if that should be applied on this crate. I think user (in this case, reth?) should remove this crate with #cfg() instead.

lambdalisue avatar Jan 03 '24 16:01 lambdalisue

Maybe we can add dummy feature that add a dummy collector that is used for non supported platform?

lambdalisue avatar Jan 05 '24 07:01 lambdalisue

that would be very useful imo, just so that it compiles

mattsse avatar Jan 05 '24 17:01 mattsse

A dummy feature is added. Please close the issue if that is what you needed actually or keep open it if you really need FreeBSD support @yurivict

lambdalisue avatar Jan 06 '24 08:01 lambdalisue

#53

lambdalisue avatar Oct 09 '24 21:10 lambdalisue