// Metrics returns the collected group event metrics.
Metrics returns the collected group event metrics.
// Metrics returns the collected group event metrics .
func (p *GroupProfiler) Metrics() Metrics {
	gc, _ := p.ReadGroupCount()
	if gc.Running == 0 {
		return Metrics{}
	}
	scale := float64(gc.Enabled) / float64(gc.Running)
	if gc.Enabled != gc.Running {
		logger.Printf("%s: multiplexing occurred (enabled: %s, running %s)\n", "group", gc.Enabled, gc.Running)
	}
	var results []Result
	for _, v := range gc.Values {
		results = append(results, Result{
			Value: uint64(float64(v.Value) * scale),
			Label: v.Label,
		})
	}
	return Metrics{
		Results: results,
		Elapsed: gc.Enabled - p.enabled,
	}
}
func ( p * GroupProfiler ) Metrics ( ) Metrics { gc , _ := p . ReadGroupCount ( ) if gc . Running == 0 { return Metrics { } } scale := float64 ( gc . Enabled ) / float64 ( gc . Running ) if gc . Enabled != gc . Running { logger . Printf ( " \n " , " " , gc . Enabled , gc . Running ) } var results [ ] Result for _ , v := range gc . Values { results = append ( results , Result { Value : uint64 ( float64 ( v . Value ) * scale ) , Label : v . Label , } ) } return Metrics { Results : results , Elapsed : gc . Enabled - p . enabled , } }
Metrics returns the collected group event metrics.
Metrics returns the collected group event metrics .