Add collector for /proc/stat, enabled by default.

This gives cpu stats, boot time, context switches, forks.
It can't be called node_interrupts as that'd clash with the 'interrupts'
collector. There is the option not to export this and enable the interrupts
collector by default, but my belief is that the vast majority of users
don't need that level of granularity so there's no point spending the
cpu/ram/network.


On 6 June 2014 10:07, juliusv <notifications@github.com> wrote:

> In collector/stat.go:
>
> > +
> > +// Takes a config struct and prometheus registry and returns a new Collector exposing
> > +// network device stats.
> > +func NewStatCollector(config Config, registry prometheus.Registry) (Collector, error) {
> > +	c := statCollector{
> > +		config:   config,
> > +		registry: registry,
> > +	}
> > +	registry.Register(
> > +		"node_cpu",
> > +		"Seconds the cpus spent in each mode.",
> > +		prometheus.NilLabels,
> > +		cpuMetrics,
> > +	)
> > +	registry.Register(
> > +		"node_intr",
>
> Is it worth keeping the naming from /proc/stat here or would
> node_interrupts be nicer? No strong feelings either way.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/prometheus/node_exporter/pull/14/files#r13481672>.
>