Closed siddharth178 closed 6 years ago
This alone would not be sufficient, unfortunately.
The options
struct is not exported, so Collect()
would not be callable from outside the package. It's not fair to export options
because it has things not related to collection (output format etc). Also, you won't want to import github.com/rapidloop/pgmetrics/cmd/pgmetrics
since it is a main
package.
Okk, got it. Valid points.
I will issue another PR soon to have that collector
package separated out.
Fixes: https://github.com/rapidloop/pgmetrics/issues/13
pgmetrics is a great command-line tool. but running this specific commandline in every environment is not ideal.
collect
public, it can be used as library.this is the minimal change one can do to make it work like a library. separating it out as a real library can be taken as a separate task and i think it would be only necessary if this simple setup doesn't work.