metrics

package
v0.1.73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Metric_Kind_name = map[int32]string{
		0: "KIND_UNKNOWN",
		1: "KIND_COUNT",
		2: "KIND_SUM",
		3: "KIND_MAX",
	}
	Metric_Kind_value = map[string]int32{
		"KIND_UNKNOWN": 0,
		"KIND_COUNT":   1,
		"KIND_SUM":     2,
		"KIND_MAX":     3,
	}
)

Enum value maps for Metric_Kind.

Functions

This section is empty.

Types

type AddMetricRequest

type AddMetricRequest struct {

	// Player is the player's server slot.
	Player int32 `protobuf:"varint,1,opt,name=player,proto3" json:"player,omitempty"`
	// Name names a metric the manifest declares.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Value is the amount a sum adds and the value a maximum compares; a
	// count adds one.
	Value float64 `protobuf:"fixed64,3,opt,name=value,proto3" json:"value,omitempty"`
	// Label is one of the metric's declared labels, or empty for a metric
	// without labels.
	Label *string `protobuf:"bytes,4,opt,name=label,proto3,oneof" json:"label,omitempty"`
	// contains filtered or unexported fields
}

AddMetricRequest adds to one of a player's metric totals.

func (*AddMetricRequest) CloneMessageVT

func (m *AddMetricRequest) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*AddMetricRequest) CloneVT

func (m *AddMetricRequest) CloneVT() *AddMetricRequest

func (*AddMetricRequest) EqualMessageVT

func (this *AddMetricRequest) EqualMessageVT(thatMsg any) bool

func (*AddMetricRequest) EqualVT

func (this *AddMetricRequest) EqualVT(that *AddMetricRequest) bool

func (*AddMetricRequest) GetLabel

func (x *AddMetricRequest) GetLabel() string

func (*AddMetricRequest) GetName

func (x *AddMetricRequest) GetName() string

func (*AddMetricRequest) GetPlayer

func (x *AddMetricRequest) GetPlayer() int32

func (*AddMetricRequest) GetValue

func (x *AddMetricRequest) GetValue() float64

func (*AddMetricRequest) MarshalJSON

func (x *AddMetricRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the AddMetricRequest to JSON.

func (*AddMetricRequest) MarshalProtoJSON

func (x *AddMetricRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the AddMetricRequest message to JSON.

func (*AddMetricRequest) MarshalProtoText

func (x *AddMetricRequest) MarshalProtoText() string

func (*AddMetricRequest) MarshalToSizedBufferVT

func (m *AddMetricRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*AddMetricRequest) MarshalToVT

func (m *AddMetricRequest) MarshalToVT(dAtA []byte) (int, error)

func (*AddMetricRequest) MarshalVT

func (m *AddMetricRequest) MarshalVT() (dAtA []byte, err error)

func (*AddMetricRequest) ProtoMessage

func (*AddMetricRequest) ProtoMessage()

func (*AddMetricRequest) Reset

func (x *AddMetricRequest) Reset()

func (*AddMetricRequest) SizeVT

func (m *AddMetricRequest) SizeVT() (n int)

func (*AddMetricRequest) String

func (x *AddMetricRequest) String() string

func (*AddMetricRequest) UnmarshalJSON

func (x *AddMetricRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the AddMetricRequest from JSON.

func (*AddMetricRequest) UnmarshalProtoJSON

func (x *AddMetricRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the AddMetricRequest message from JSON.

func (*AddMetricRequest) UnmarshalVT

func (m *AddMetricRequest) UnmarshalVT(dAtA []byte) error

type Metric

type Metric struct {

	// Name names the metric in the mod's code: up to 64 letters, digits,
	// underscores and dots, starting with a letter or an underscore.
	Name string      `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Kind Metric_Kind `protobuf:"varint,2,opt,name=kind,proto3" json:"kind,omitempty"`
	// Labels are the values a call may label the metric with: letters,
	// digits, dots, underscores and hyphens. Empty takes no label.
	Labels []string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"`
	// contains filtered or unexported fields
}

Metric is one measure a mod keeps for each player, such as how often the player opens a HUD panel. A metric with labels keeps one total per label, such as one per HUD layout.

func (*Metric) CloneMessageVT

func (m *Metric) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Metric) CloneVT

func (m *Metric) CloneVT() *Metric

func (*Metric) EqualMessageVT

func (this *Metric) EqualMessageVT(thatMsg any) bool

func (*Metric) EqualVT

func (this *Metric) EqualVT(that *Metric) bool

func (*Metric) GetKind

func (x *Metric) GetKind() Metric_Kind

func (*Metric) GetLabels

func (x *Metric) GetLabels() []string

func (*Metric) GetName

func (x *Metric) GetName() string

func (*Metric) MarshalJSON

func (x *Metric) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Metric to JSON.

func (*Metric) MarshalProtoJSON

func (x *Metric) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Metric message to JSON.

func (*Metric) MarshalProtoText

func (x *Metric) MarshalProtoText() string

func (*Metric) MarshalToSizedBufferVT

func (m *Metric) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Metric) MarshalToVT

func (m *Metric) MarshalToVT(dAtA []byte) (int, error)

func (*Metric) MarshalVT

func (m *Metric) MarshalVT() (dAtA []byte, err error)

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) Reset

func (x *Metric) Reset()

func (*Metric) SizeVT

func (m *Metric) SizeVT() (n int)

func (*Metric) String

func (x *Metric) String() string

func (*Metric) UnmarshalJSON

func (x *Metric) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Metric from JSON.

func (*Metric) UnmarshalProtoJSON

func (x *Metric) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Metric message from JSON.

func (*Metric) UnmarshalVT

func (m *Metric) UnmarshalVT(dAtA []byte) error

type MetricTotal

type MetricTotal struct {
	Name  string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Label string  `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	Value float64 `protobuf:"fixed64,3,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

MetricTotal is one player's total of one metric and label.

func (*MetricTotal) CloneMessageVT

func (m *MetricTotal) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*MetricTotal) CloneVT

func (m *MetricTotal) CloneVT() *MetricTotal

func (*MetricTotal) EqualMessageVT

func (this *MetricTotal) EqualMessageVT(thatMsg any) bool

func (*MetricTotal) EqualVT

func (this *MetricTotal) EqualVT(that *MetricTotal) bool

func (*MetricTotal) GetLabel

func (x *MetricTotal) GetLabel() string

func (*MetricTotal) GetName

func (x *MetricTotal) GetName() string

func (*MetricTotal) GetValue

func (x *MetricTotal) GetValue() float64

func (*MetricTotal) MarshalJSON

func (x *MetricTotal) MarshalJSON() ([]byte, error)

MarshalJSON marshals the MetricTotal to JSON.

func (*MetricTotal) MarshalProtoJSON

func (x *MetricTotal) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the MetricTotal message to JSON.

func (*MetricTotal) MarshalProtoText

func (x *MetricTotal) MarshalProtoText() string

func (*MetricTotal) MarshalToSizedBufferVT

func (m *MetricTotal) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*MetricTotal) MarshalToVT

func (m *MetricTotal) MarshalToVT(dAtA []byte) (int, error)

func (*MetricTotal) MarshalVT

func (m *MetricTotal) MarshalVT() (dAtA []byte, err error)

func (*MetricTotal) ProtoMessage

func (*MetricTotal) ProtoMessage()

func (*MetricTotal) Reset

func (x *MetricTotal) Reset()

func (*MetricTotal) SizeVT

func (m *MetricTotal) SizeVT() (n int)

func (*MetricTotal) String

func (x *MetricTotal) String() string

func (*MetricTotal) UnmarshalJSON

func (x *MetricTotal) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the MetricTotal from JSON.

func (*MetricTotal) UnmarshalProtoJSON

func (x *MetricTotal) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the MetricTotal message from JSON.

func (*MetricTotal) UnmarshalVT

func (m *MetricTotal) UnmarshalVT(dAtA []byte) error

type MetricTotals

type MetricTotals struct {
	Totals []*MetricTotal `protobuf:"bytes,1,rep,name=totals,proto3" json:"totals,omitempty"`
	// contains filtered or unexported fields
}

MetricTotals are one player's totals for one mod's session.

func (*MetricTotals) CloneMessageVT

func (m *MetricTotals) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*MetricTotals) CloneVT

func (m *MetricTotals) CloneVT() *MetricTotals

func (*MetricTotals) EqualMessageVT

func (this *MetricTotals) EqualMessageVT(thatMsg any) bool

func (*MetricTotals) EqualVT

func (this *MetricTotals) EqualVT(that *MetricTotals) bool

func (*MetricTotals) GetTotals

func (x *MetricTotals) GetTotals() []*MetricTotal

func (*MetricTotals) MarshalJSON

func (x *MetricTotals) MarshalJSON() ([]byte, error)

MarshalJSON marshals the MetricTotals to JSON.

func (*MetricTotals) MarshalProtoJSON

func (x *MetricTotals) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the MetricTotals message to JSON.

func (*MetricTotals) MarshalProtoText

func (x *MetricTotals) MarshalProtoText() string

func (*MetricTotals) MarshalToSizedBufferVT

func (m *MetricTotals) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*MetricTotals) MarshalToVT

func (m *MetricTotals) MarshalToVT(dAtA []byte) (int, error)

func (*MetricTotals) MarshalVT

func (m *MetricTotals) MarshalVT() (dAtA []byte, err error)

func (*MetricTotals) ProtoMessage

func (*MetricTotals) ProtoMessage()

func (*MetricTotals) Reset

func (x *MetricTotals) Reset()

func (*MetricTotals) SizeVT

func (m *MetricTotals) SizeVT() (n int)

func (*MetricTotals) String

func (x *MetricTotals) String() string

func (*MetricTotals) UnmarshalJSON

func (x *MetricTotals) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the MetricTotals from JSON.

func (*MetricTotals) UnmarshalProtoJSON

func (x *MetricTotals) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the MetricTotals message from JSON.

func (*MetricTotals) UnmarshalVT

func (m *MetricTotals) UnmarshalVT(dAtA []byte) error

type Metric_Kind

type Metric_Kind int32

Kind is how a metric combines the values added to it.

const (
	// KIND_UNKNOWN is an unset or unsupported kind.
	Metric_KIND_UNKNOWN Metric_Kind = 0
	// KIND_COUNT counts the calls.
	Metric_KIND_COUNT Metric_Kind = 1
	// KIND_SUM adds the values.
	Metric_KIND_SUM Metric_Kind = 2
	// KIND_MAX keeps the largest value.
	Metric_KIND_MAX Metric_Kind = 3
)

func (Metric_Kind) Enum

func (x Metric_Kind) Enum() *Metric_Kind

func (Metric_Kind) MarshalJSON

func (x Metric_Kind) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Metric_Kind to JSON.

func (Metric_Kind) MarshalProtoJSON

func (x Metric_Kind) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Metric_Kind to JSON.

func (Metric_Kind) MarshalProtoText

func (x Metric_Kind) MarshalProtoText() string

func (Metric_Kind) MarshalText

func (x Metric_Kind) MarshalText() ([]byte, error)

MarshalText marshals the Metric_Kind to text.

func (Metric_Kind) String

func (x Metric_Kind) String() string

func (*Metric_Kind) UnmarshalJSON

func (x *Metric_Kind) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Metric_Kind from JSON.

func (*Metric_Kind) UnmarshalProtoJSON

func (x *Metric_Kind) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Metric_Kind from JSON.

func (*Metric_Kind) UnmarshalText

func (x *Metric_Kind) UnmarshalText(b []byte) error

UnmarshalText unmarshals the Metric_Kind from text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL