func (r *Room) SetGauge1(
	ctx context.Context,
	arg *messages.SetGaugeArg,
) (*messages.Response, error) {
	counterMetricName := "my_gauge_1"
	for _, reporter := range r.app.GetMetricsReporters() {
		reporter.ReportGauge(counterMetricName, map[string]string{
			"tag1": arg.Tag,
		}, arg.Value)
	}
	return messages.OKResponse(), nil
}
SetGauge1 sets custom my_gauge_1
package services
import (
	"context"
	"github.com/topfreegames/pitaya/v2"
	"github.com/topfreegames/pitaya/v2/component"
	"github.com/topfreegames/pitaya/v2/examples/demo/custom_metrics/messages"
)
type Room struct {
	component.Base
	app pitaya.Pitaya
}
func NewRoom(app pitaya.Pitaya) *Room {
	return &Room{
		app: app,
	}
}
func (r *Room) SetCounter(
	ctx context.Context,
	arg *messages.SetCounterArg,
) (*messages.Response, error) {
	counterMetricName := "my_counter"
	for _, reporter := range r.app.GetMetricsReporters() {
		reporter.ReportCount(counterMetricName, map[string]string{
			"tag1": arg.Tag1,
			"tag2": arg.Tag2,
		}, arg.Value)
	}
	return messages.OKResponse(), nil
}