sys.json icon indicating copy to clipboard operation
sys.json copied to clipboard

standardizing on an existing lib

Open colebrumley opened this issue 9 years ago • 2 comments

What do you think about standardizing on https://github.com/c9s/goprocinfo? It duplicates a lot of the stats you're gathering plus some additional ones and a lot of it is already tested. That'd knock out a couple things from the to do list (standardizing the api + some of the testing).

I did notice though that its disk stats aren't as detailed as sysjson's.

colebrumley avatar Mar 08 '15 20:03 colebrumley

I suggest sys.json should use a more modular system. Maybe something like this:

  • plugin: which is OS depedent, contributor can collect stats data with their own way
  • plugin registry: something like the modules table
  • stat collector: plugin should return something like [TextMarshaler[(http://golang.org/pkg/encoding/#TextMarshaler) (or something is at least JSON renderable),which the encoder can render the results (maybe with nested struct, just like the loadModule)
  • encoder: which can render the plugin result into other form with specify ways (like JSON over HTTP, JSON over stream)

Of course, this may seems overwhelming for a toy project. :D

bcho avatar Mar 09 '15 02:03 bcho

Interesting. I'll probably take a closer look at this over the weekend.

EricR avatar Mar 12 '15 22:03 EricR