// Copyright (C) 2024  mieru authors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.11
// 	protoc        v6.33.5
// source: metrics/proto/metrics.proto

package metricspb

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type MetricType int32

const (
	MetricType_UNSPECIFIED         MetricType = 0
	MetricType_COUNTER             MetricType = 1
	MetricType_COUNTER_TIME_SERIES MetricType = 2 // only this type has history
	MetricType_GAUGE               MetricType = 3
)

// Enum value maps for MetricType.
var (
	MetricType_name = map[int32]string{
		0: "UNSPECIFIED",
		1: "COUNTER",
		2: "COUNTER_TIME_SERIES",
		3: "GAUGE",
	}
	MetricType_value = map[string]int32{
		"UNSPECIFIED":         0,
		"COUNTER":             1,
		"COUNTER_TIME_SERIES": 2,
		"GAUGE":               3,
	}
)

func (x MetricType) Enum() *MetricType {
	p := new(MetricType)
	*p = x
	return p
}

func (x MetricType) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (MetricType) Descriptor() protoreflect.EnumDescriptor {
	return file_metrics_proto_metrics_proto_enumTypes[0].Descriptor()
}

func (MetricType) Type() protoreflect.EnumType {
	return &file_metrics_proto_metrics_proto_enumTypes[0]
}

func (x MetricType) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use MetricType.Descriptor instead.
func (MetricType) EnumDescriptor() ([]byte, []int) {
	return file_metrics_proto_metrics_proto_rawDescGZIP(), []int{0}
}

type RollUpLabel int32

const (
	RollUpLabel_NO_ROLL_UP        RollUpLabel = 0
	RollUpLabel_ROLL_UP_TO_SECOND RollUpLabel = 1
	RollUpLabel_ROLL_UP_TO_MINUTE RollUpLabel = 2
	RollUpLabel_ROLL_UP_TO_HOUR   RollUpLabel = 3
	RollUpLabel_ROLL_UP_TO_DAY    RollUpLabel = 4
)

// Enum value maps for RollUpLabel.
var (
	RollUpLabel_name = map[int32]string{
		0: "NO_ROLL_UP",
		1: "ROLL_UP_TO_SECOND",
		2: "ROLL_UP_TO_MINUTE",
		3: "ROLL_UP_TO_HOUR",
		4: "ROLL_UP_TO_DAY",
	}
	RollUpLabel_value = map[string]int32{
		"NO_ROLL_UP":        0,
		"ROLL_UP_TO_SECOND": 1,
		"ROLL_UP_TO_MINUTE": 2,
		"ROLL_UP_TO_HOUR":   3,
		"ROLL_UP_TO_DAY":    4,
	}
)

func (x RollUpLabel) Enum() *RollUpLabel {
	p := new(RollUpLabel)
	*p = x
	return p
}

func (x RollUpLabel) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (RollUpLabel) Descriptor() protoreflect.EnumDescriptor {
	return file_metrics_proto_metrics_proto_enumTypes[1].Descriptor()
}

func (RollUpLabel) Type() protoreflect.EnumType {
	return &file_metrics_proto_metrics_proto_enumTypes[1]
}

func (x RollUpLabel) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use RollUpLabel.Descriptor instead.
func (RollUpLabel) EnumDescriptor() ([]byte, []int) {
	return file_metrics_proto_metrics_proto_rawDescGZIP(), []int{1}
}

type AllMetrics struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Groups        []*MetricGroup         `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *AllMetrics) Reset() {
	*x = AllMetrics{}
	mi := &file_metrics_proto_metrics_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *AllMetrics) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*AllMetrics) ProtoMessage() {}

func (x *AllMetrics) ProtoReflect() protoreflect.Message {
	mi := &file_metrics_proto_metrics_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use AllMetrics.ProtoReflect.Descriptor instead.
func (*AllMetrics) Descriptor() ([]byte, []int) {
	return file_metrics_proto_metrics_proto_rawDescGZIP(), []int{0}
}

func (x *AllMetrics) GetGroups() []*MetricGroup {
	if x != nil {
		return x.Groups
	}
	return nil
}

type MetricGroup struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Name          *string                `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"`
	Metrics       []*Metric              `protobuf:"bytes,2,rep,name=metrics,proto3" json:"metrics,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *MetricGroup) Reset() {
	*x = MetricGroup{}
	mi := &file_metrics_proto_metrics_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *MetricGroup) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*MetricGroup) ProtoMessage() {}

func (x *MetricGroup) ProtoReflect() protoreflect.Message {
	mi := &file_metrics_proto_metrics_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use MetricGroup.ProtoReflect.Descriptor instead.
func (*MetricGroup) Descriptor() ([]byte, []int) {
	return file_metrics_proto_metrics_proto_rawDescGZIP(), []int{1}
}

func (x *MetricGroup) GetName() string {
	if x != nil && x.Name != nil {
		return *x.Name
	}
	return ""
}

func (x *MetricGroup) GetMetrics() []*Metric {
	if x != nil {
		return x.Metrics
	}
	return nil
}

type Metric struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Name          *string                `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"`
	Type          *MetricType            `protobuf:"varint,2,opt,name=type,proto3,enum=mieru.metrics.MetricType,oneof" json:"type,omitempty"`
	Value         *int64                 `protobuf:"varint,3,opt,name=value,proto3,oneof" json:"value,omitempty"`
	History       []*History             `protobuf:"bytes,4,rep,name=history,proto3" json:"history,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Metric) Reset() {
	*x = Metric{}
	mi := &file_metrics_proto_metrics_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Metric) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Metric) ProtoMessage() {}

func (x *Metric) ProtoReflect() protoreflect.Message {
	mi := &file_metrics_proto_metrics_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Metric.ProtoReflect.Descriptor instead.
func (*Metric) Descriptor() ([]byte, []int) {
	return file_metrics_proto_metrics_proto_rawDescGZIP(), []int{2}
}

func (x *Metric) GetName() string {
	if x != nil && x.Name != nil {
		return *x.Name
	}
	return ""
}

func (x *Metric) GetType() MetricType {
	if x != nil && x.Type != nil {
		return *x.Type
	}
	return MetricType_UNSPECIFIED
}

func (x *Metric) GetValue() int64 {
	if x != nil && x.Value != nil {
		return *x.Value
	}
	return 0
}

func (x *Metric) GetHistory() []*History {
	if x != nil {
		return x.History
	}
	return nil
}

type History struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	TimeUnixMilli *int64                 `protobuf:"varint,1,opt,name=timeUnixMilli,proto3,oneof" json:"timeUnixMilli,omitempty"`
	Delta         *int64                 `protobuf:"varint,2,opt,name=delta,proto3,oneof" json:"delta,omitempty"`
	RollUp        *RollUpLabel           `protobuf:"varint,3,opt,name=rollUp,proto3,enum=mieru.metrics.RollUpLabel,oneof" json:"rollUp,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *History) Reset() {
	*x = History{}
	mi := &file_metrics_proto_metrics_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *History) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*History) ProtoMessage() {}

func (x *History) ProtoReflect() protoreflect.Message {
	mi := &file_metrics_proto_metrics_proto_msgTypes[3]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use History.ProtoReflect.Descriptor instead.
func (*History) Descriptor() ([]byte, []int) {
	return file_metrics_proto_metrics_proto_rawDescGZIP(), []int{3}
}

func (x *History) GetTimeUnixMilli() int64 {
	if x != nil && x.TimeUnixMilli != nil {
		return *x.TimeUnixMilli
	}
	return 0
}

func (x *History) GetDelta() int64 {
	if x != nil && x.Delta != nil {
		return *x.Delta
	}
	return 0
}

func (x *History) GetRollUp() RollUpLabel {
	if x != nil && x.RollUp != nil {
		return *x.RollUp
	}
	return RollUpLabel_NO_ROLL_UP
}

var File_metrics_proto_metrics_proto protoreflect.FileDescriptor

const file_metrics_proto_metrics_proto_rawDesc = "" +
	"\n" +
	"\x1bmetrics/proto/metrics.proto\x12\rmieru.metrics\"@\n" +
	"\n" +
	"AllMetrics\x122\n" +
	"\x06groups\x18\x01 \x03(\v2\x1a.mieru.metrics.MetricGroupR\x06groups\"`\n" +
	"\vMetricGroup\x12\x17\n" +
	"\x04name\x18\x01 \x01(\tH\x00R\x04name\x88\x01\x01\x12/\n" +
	"\ametrics\x18\x02 \x03(\v2\x15.mieru.metrics.MetricR\ametricsB\a\n" +
	"\x05_name\"\xbe\x01\n" +
	"\x06Metric\x12\x17\n" +
	"\x04name\x18\x01 \x01(\tH\x00R\x04name\x88\x01\x01\x122\n" +
	"\x04type\x18\x02 \x01(\x0e2\x19.mieru.metrics.MetricTypeH\x01R\x04type\x88\x01\x01\x12\x19\n" +
	"\x05value\x18\x03 \x01(\x03H\x02R\x05value\x88\x01\x01\x120\n" +
	"\ahistory\x18\x04 \x03(\v2\x16.mieru.metrics.HistoryR\ahistoryB\a\n" +
	"\x05_nameB\a\n" +
	"\x05_typeB\b\n" +
	"\x06_value\"\xaf\x01\n" +
	"\aHistory\x12)\n" +
	"\rtimeUnixMilli\x18\x01 \x01(\x03H\x00R\rtimeUnixMilli\x88\x01\x01\x12\x19\n" +
	"\x05delta\x18\x02 \x01(\x03H\x01R\x05delta\x88\x01\x01\x127\n" +
	"\x06rollUp\x18\x03 \x01(\x0e2\x1a.mieru.metrics.RollUpLabelH\x02R\x06rollUp\x88\x01\x01B\x10\n" +
	"\x0e_timeUnixMilliB\b\n" +
	"\x06_deltaB\t\n" +
	"\a_rollUp*N\n" +
	"\n" +
	"MetricType\x12\x0f\n" +
	"\vUNSPECIFIED\x10\x00\x12\v\n" +
	"\aCOUNTER\x10\x01\x12\x17\n" +
	"\x13COUNTER_TIME_SERIES\x10\x02\x12\t\n" +
	"\x05GAUGE\x10\x03*t\n" +
	"\vRollUpLabel\x12\x0e\n" +
	"\n" +
	"NO_ROLL_UP\x10\x00\x12\x15\n" +
	"\x11ROLL_UP_TO_SECOND\x10\x01\x12\x15\n" +
	"\x11ROLL_UP_TO_MINUTE\x10\x02\x12\x13\n" +
	"\x0fROLL_UP_TO_HOUR\x10\x03\x12\x12\n" +
	"\x0eROLL_UP_TO_DAY\x10\x04B2Z0github.com/enfein/mieru/v3/pkg/metrics/metricspbb\x06proto3"

var (
	file_metrics_proto_metrics_proto_rawDescOnce sync.Once
	file_metrics_proto_metrics_proto_rawDescData []byte
)

func file_metrics_proto_metrics_proto_rawDescGZIP() []byte {
	file_metrics_proto_metrics_proto_rawDescOnce.Do(func() {
		file_metrics_proto_metrics_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_metrics_proto_metrics_proto_rawDesc), len(file_metrics_proto_metrics_proto_rawDesc)))
	})
	return file_metrics_proto_metrics_proto_rawDescData
}

var file_metrics_proto_metrics_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_metrics_proto_metrics_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_metrics_proto_metrics_proto_goTypes = []any{
	(MetricType)(0),     // 0: mieru.metrics.MetricType
	(RollUpLabel)(0),    // 1: mieru.metrics.RollUpLabel
	(*AllMetrics)(nil),  // 2: mieru.metrics.AllMetrics
	(*MetricGroup)(nil), // 3: mieru.metrics.MetricGroup
	(*Metric)(nil),      // 4: mieru.metrics.Metric
	(*History)(nil),     // 5: mieru.metrics.History
}
var file_metrics_proto_metrics_proto_depIdxs = []int32{
	3, // 0: mieru.metrics.AllMetrics.groups:type_name -> mieru.metrics.MetricGroup
	4, // 1: mieru.metrics.MetricGroup.metrics:type_name -> mieru.metrics.Metric
	0, // 2: mieru.metrics.Metric.type:type_name -> mieru.metrics.MetricType
	5, // 3: mieru.metrics.Metric.history:type_name -> mieru.metrics.History
	1, // 4: mieru.metrics.History.rollUp:type_name -> mieru.metrics.RollUpLabel
	5, // [5:5] is the sub-list for method output_type
	5, // [5:5] is the sub-list for method input_type
	5, // [5:5] is the sub-list for extension type_name
	5, // [5:5] is the sub-list for extension extendee
	0, // [0:5] is the sub-list for field type_name
}

func init() { file_metrics_proto_metrics_proto_init() }
func file_metrics_proto_metrics_proto_init() {
	if File_metrics_proto_metrics_proto != nil {
		return
	}
	file_metrics_proto_metrics_proto_msgTypes[1].OneofWrappers = []any{}
	file_metrics_proto_metrics_proto_msgTypes[2].OneofWrappers = []any{}
	file_metrics_proto_metrics_proto_msgTypes[3].OneofWrappers = []any{}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_metrics_proto_metrics_proto_rawDesc), len(file_metrics_proto_metrics_proto_rawDesc)),
			NumEnums:      2,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_metrics_proto_metrics_proto_goTypes,
		DependencyIndexes: file_metrics_proto_metrics_proto_depIdxs,
		EnumInfos:         file_metrics_proto_metrics_proto_enumTypes,
		MessageInfos:      file_metrics_proto_metrics_proto_msgTypes,
	}.Build()
	File_metrics_proto_metrics_proto = out.File
	file_metrics_proto_metrics_proto_goTypes = nil
	file_metrics_proto_metrics_proto_depIdxs = nil
}
