diff --git a/Gopkg.lock b/Gopkg.lock index 4c026d69e7..a327fcb490 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -204,7 +204,7 @@ [[projects]] branch = "PMM-2.0" - digest = "1:cf2523987374f49c1b2d93d60d1c86d42bacba11baadafb888b1c010d8104f11" + digest = "1:ba2b945da955d495bc2c9305b99ccbc8026eea979067f26c4a7cd2a59b6c42e8" name = "github.com/percona/pmm" packages = [ "api/agentpb", @@ -215,7 +215,7 @@ "version", ] pruneopts = "NUT" - revision = "0b99bc21e13aa99b21e9b572b827d86c2dfb4f7b" + revision = "49f16d399ebc2b123d8e3719aaed71ed0dcfdc32" [[projects]] digest = "1:14715f705ff5dfe0ffd6571d7d201dd8e921030f8070321a79380d8ca4ec1a24" diff --git a/models/agent_helpers.go b/models/agent_helpers.go index f65d0a5494..d163516260 100644 --- a/models/agent_helpers.go +++ b/models/agent_helpers.go @@ -181,6 +181,10 @@ func AgentAddExporter(q *reform.Querier, agentType AgentType, params *AddExporte return nil, err } + if _, err := AgentFindByID(q, params.PMMAgentID); err != nil { + return nil, err + } + if _, err := FindServiceByID(q, params.ServiceID); err != nil { return nil, err } diff --git a/models/service_helpers.go b/models/service_helpers.go index 7ddee8b09c..bb1922be8d 100644 --- a/models/service_helpers.go +++ b/models/service_helpers.go @@ -88,6 +88,21 @@ func ServicesForAgent(q *reform.Querier, agentID string) ([]*Service, error) { return res, nil } +// ServicesForNode returns all Services for Node with given ID. +func ServicesForNode(q *reform.Querier, nodeID string) ([]*Service, error) { + tail := fmt.Sprintf("WHERE node_id = %s ORDER BY service_id", q.Placeholder(1)) //nolint:gosec + structs, err := q.SelectAllFrom(ServiceTable, tail, nodeID) + if err != nil { + return nil, errors.Wrap(err, "failed to select Services") + } + + res := make([]*Service, len(structs)) + for i, s := range structs { + res[i] = s.(*Service) + } + return res, nil +} + func checkServiceUniqueID(q *reform.Querier, id string) error { if id == "" { panic("empty Service ID") diff --git a/services/agents/postgresql.go b/services/agents/postgresql.go index ce99585823..79a0ba2041 100644 --- a/services/agents/postgresql.go +++ b/services/agents/postgresql.go @@ -34,7 +34,9 @@ func postgresqlDSN(service *models.Service, exporter *models.Agent) string { q.Set("sslmode", "disable") // TODO: make it configurable q.Set("connect_timeout", "5") - address := net.JoinHostPort(*service.Address, strconv.Itoa(int(*service.Port))) + host := pointer.GetString(service.Address) + port := pointer.GetUint16(service.Port) + address := net.JoinHostPort(host, strconv.Itoa(int(port))) uri := url.URL{ Scheme: "postgres", User: url.UserPassword(*exporter.Username, *exporter.Password), diff --git a/services/inventory/grpc/services_server.go b/services/inventory/grpc/services_server.go index a21d916311..ed4500a117 100644 --- a/services/inventory/grpc/services_server.go +++ b/services/inventory/grpc/services_server.go @@ -37,9 +37,12 @@ func NewServicesServer(s *inventory.ServicesService) inventorypb.ServicesServer return &servicesServer{s} } -// ListServices returns a list of all Services. +// ListServices returns a list of Services for a given filters. func (s *servicesServer) ListServices(ctx context.Context, req *inventorypb.ListServicesRequest) (*inventorypb.ListServicesResponse, error) { - services, err := s.s.List(ctx) + filters := inventory.ServiceFilters{ + NodeID: req.GetNodeId(), + } + services, err := s.s.List(ctx, filters) if err != nil { return nil, err } @@ -53,6 +56,8 @@ func (s *servicesServer) ListServices(ctx context.Context, req *inventorypb.List res.AmazonRdsMysql = append(res.AmazonRdsMysql, service) case *inventorypb.MongoDBService: res.Mongodb = append(res.Mongodb, service) + case *inventorypb.PostgreSQLService: + res.Postgresql = append(res.Postgresql, service) default: panic(fmt.Errorf("unhandled inventory Service type %T", service)) } @@ -75,6 +80,8 @@ func (s *servicesServer) GetService(ctx context.Context, req *inventorypb.GetSer res.Service = &inventorypb.GetServiceResponse_AmazonRdsMysql{AmazonRdsMysql: service} case *inventorypb.MongoDBService: res.Service = &inventorypb.GetServiceResponse_Mongodb{Mongodb: service} + case *inventorypb.PostgreSQLService: + res.Service = &inventorypb.GetServiceResponse_Postgresql{Postgresql: service} default: panic(fmt.Errorf("unhandled inventory Service type %T", service)) } diff --git a/services/inventory/services.go b/services/inventory/services.go index 9f56de2ab6..1a6c212b95 100644 --- a/services/inventory/services.go +++ b/services/inventory/services.go @@ -41,13 +41,24 @@ func NewServicesService(db *reform.DB, r registry) *ServicesService { } } +// ServiceFilters represents filters for services list. +type ServiceFilters struct { + // Return only Services runs on that Node. + NodeID string +} + // List selects all Services in a stable order. //nolint:unparam -func (ss *ServicesService) List(ctx context.Context) ([]inventorypb.Service, error) { +func (ss *ServicesService) List(ctx context.Context, filters ServiceFilters) ([]inventorypb.Service, error) { services := make([]*models.Service, 0) e := ss.db.InTransaction(func(tx *reform.TX) error { var err error - services, err = models.FindAllServices(tx.Querier) + switch { + case filters.NodeID != "": + services, err = models.ServicesForNode(tx.Querier, filters.NodeID) + default: + services, err = models.FindAllServices(tx.Querier) + } if err != nil { return err } diff --git a/services/inventory/services_test.go b/services/inventory/services_test.go index 4b2055cd6b..10bbc39dc3 100644 --- a/services/inventory/services_test.go +++ b/services/inventory/services_test.go @@ -59,7 +59,7 @@ func TestServices(t *testing.T) { ss, teardown := setup(t) defer teardown(t) - actualServices, err := ss.List(ctx) + actualServices, err := ss.List(ctx, ServiceFilters{}) require.NoError(t, err) require.Len(t, actualServices, 0) @@ -83,7 +83,7 @@ func TestServices(t *testing.T) { require.NoError(t, err) assert.Equal(t, expectedService, actualService) - actualServices, err = ss.List(ctx) + actualServices, err = ss.List(ctx, ServiceFilters{}) require.NoError(t, err) require.Len(t, actualServices, 1) assert.Equal(t, expectedService, actualServices[0]) @@ -114,7 +114,7 @@ func TestServices(t *testing.T) { require.NoError(t, err) assert.Equal(t, expectedMdbService, actualService) - actualServices, err = ss.List(ctx) + actualServices, err = ss.List(ctx, ServiceFilters{}) require.NoError(t, err) require.Len(t, actualServices, 1) assert.Equal(t, expectedMdbService, actualServices[0]) @@ -145,7 +145,7 @@ func TestServices(t *testing.T) { require.NoError(t, err) assert.Equal(t, expectedPostgreSQLService, actualService) - actualServices, err = ss.List(ctx) + actualServices, err = ss.List(ctx, ServiceFilters{NodeID: models.PMMServerNodeID}) require.NoError(t, err) require.Len(t, actualServices, 1) assert.Equal(t, expectedPostgreSQLService, actualServices[0]) diff --git a/vendor/github.com/percona/pmm/api/inventorypb/nodes.pb.go b/vendor/github.com/percona/pmm/api/inventorypb/nodes.pb.go index 2a2bf46f96..f8cdd88df9 100644 --- a/vendor/github.com/percona/pmm/api/inventorypb/nodes.pb.go +++ b/vendor/github.com/percona/pmm/api/inventorypb/nodes.pb.go @@ -764,10 +764,12 @@ type AddContainerNodeRequest struct { // Container name. DockerContainerName string `protobuf:"bytes,5,opt,name=docker_container_name,json=dockerContainerName,proto3" json:"docker_container_name,omitempty"` // Custom user-assigned labels. - CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + CustomLabels map[string]string `protobuf:"bytes,10,rep,name=custom_labels,json=customLabels,proto3" json:"custom_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Address FIXME https://jira.percona.com/browse/PMM-3786 + Address string `protobuf:"bytes,42,opt,name=address,proto3" json:"address,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AddContainerNodeRequest) Reset() { *m = AddContainerNodeRequest{} } @@ -830,6 +832,13 @@ func (m *AddContainerNodeRequest) GetCustomLabels() map[string]string { return nil } +func (m *AddContainerNodeRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + type AddContainerNodeResponse struct { Container *ContainerNode `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -1167,86 +1176,86 @@ func init() { func init() { proto.RegisterFile("inventorypb/nodes.proto", fileDescriptor_0c30c43e719d1341) } var fileDescriptor_0c30c43e719d1341 = []byte{ - // 1259 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4f, 0x4f, 0xe3, 0x46, - 0x14, 0x67, 0x0c, 0x1b, 0xc8, 0x63, 0x61, 0x93, 0xd9, 0x05, 0x5c, 0x2f, 0x7f, 0x52, 0xa3, 0xdd, - 0x66, 0xb3, 0x25, 0x5e, 0xe8, 0x6a, 0xb5, 0xe2, 0xd2, 0x06, 0x48, 0x21, 0x14, 0x42, 0xe5, 0xa5, - 0xb4, 0xbb, 0x52, 0x15, 0x99, 0x78, 0x36, 0x6b, 0x91, 0x78, 0x52, 0xdb, 0x04, 0x51, 0xf5, 0x50, - 0xf5, 0x50, 0xf5, 0xdc, 0x1e, 0x7a, 0xed, 0x47, 0xe8, 0xf7, 0xe8, 0xa9, 0x6a, 0x4f, 0xbd, 0x54, - 0x6a, 0xfb, 0x11, 0x7a, 0xa8, 0xd4, 0x4b, 0xe5, 0x99, 0x89, 0x63, 0x27, 0x4e, 0x00, 0x51, 0xd8, - 0x13, 0x9e, 0x79, 0xbf, 0xe7, 0xf7, 0x7b, 0xbf, 0x99, 0xf7, 0x9e, 0x09, 0xcc, 0x58, 0x76, 0x8b, - 0xd8, 0x1e, 0x75, 0x4e, 0x9b, 0x87, 0x9a, 0x4d, 0x4d, 0xe2, 0xe6, 0x9b, 0x0e, 0xf5, 0x28, 0x4e, - 0x06, 0x06, 0xe5, 0x49, 0xcd, 0xf2, 0x5e, 0x1d, 0x1f, 0xe6, 0xab, 0xb4, 0xa1, 0x35, 0x4e, 0x2c, - 0xef, 0x88, 0x9e, 0x68, 0x35, 0xba, 0xc4, 0x70, 0x4b, 0x2d, 0xa3, 0x6e, 0x99, 0x86, 0x47, 0x1d, - 0x57, 0x0b, 0x1e, 0xf9, 0x2b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 0x12, 0x00, 0x00, + // 1261 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xef, 0xb8, 0xdd, 0xb4, 0x79, 0xdd, 0x76, 0x93, 0xd9, 0x6d, 0x6b, 0xbc, 0xfd, 0x13, 0x5c, + 0xed, 0x92, 0xcd, 0xd2, 0x78, 0x5b, 0x56, 0xab, 0x55, 0x2f, 0x90, 0x6d, 0x43, 0x9b, 0xd2, 0xa6, + 0xc8, 0x5b, 0x0a, 0xbb, 0x12, 0x8a, 0xdc, 0x78, 0x36, 0x6b, 0x35, 0xf1, 0x04, 0xdb, 0x4d, 0x55, + 0xc4, 0x01, 0x71, 0x40, 0x9c, 0xe1, 0xc0, 0x95, 0x8f, 0xc0, 0xf7, 0xe0, 0x84, 0xe0, 0xc4, 0x05, + 0x09, 0xf1, 0x11, 0x38, 0x20, 0x21, 0x24, 0xe4, 0x99, 0x89, 0x63, 0x27, 0x4e, 0xda, 0xaa, 0xb4, + 0x3d, 0xc5, 0x33, 0xef, 0xf7, 0xfc, 0x7e, 0xf3, 0x9b, 0x79, 0xef, 0x4d, 0x0c, 0x33, 0x96, 0xdd, + 0x22, 0xb6, 0x47, 0x9d, 0x93, 0xe6, 0x81, 0x66, 0x53, 0x93, 0xb8, 0xf9, 0xa6, 0x43, 0x3d, 0x8a, + 0x93, 0x81, 0x41, 0x79, 0x52, 0xb3, 0xbc, 0xd7, 0x47, 0x07, 0xf9, 0x2a, 0x6d, 0x68, 0x8d, 0x63, + 0xcb, 0x3b, 0xa4, 0xc7, 0x5a, 0x8d, 0x2e, 0x31, 0xdc, 0x52, 0xcb, 0xa8, 0x5b, 0xa6, 0xe1, 0x51, + 0xc7, 0xd5, 0x82, 0x47, 0xfe, 0x0a, 0x65, 0xb6, 0x46, 0x69, 0xad, 0x4e, 0x34, 0xa3, 0x69, 0x69,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, 0x5f, 0x59, 0x1c, + 0x88, 0x11, 0x44, 0x1e, 0x32, 0x22, 0xf7, 0xd4, 0x4c, 0x1f, 0x22, 0x81, 0x97, 0x4f, 0xe5, 0x0b, + 0x98, 0x88, 0x54, 0x25, 0xbc, 0x70, 0x4a, 0xb9, 0x54, 0x32, 0xfd, 0x01, 0x82, 0x40, 0x96, 0x11, + 0x50, 0xd5, 0xb9, 0x3e, 0x04, 0xb8, 0x8b, 0x1f, 0xfd, 0x07, 0xc4, 0x6e, 0x04, 0x71, 0xff, 0x67, + 0xb2, 0x67, 0x2d, 0x22, 0xca, 0x83, 0x33, 0x20, 0x05, 0xb3, 0x65, 0xc6, 0xec, 0xa1, 0x7a, 0x7f, + 0x20, 0xb3, 0xc0, 0xd7, 0xa7, 0xd8, 0xe4, 0x7f, 0x21, 0x79, 0x5e, 0xe2, 0xd9, 0xae, 0x62, 0x10, + 0x49, 0x72, 0x65, 0xae, 0x8f, 0x55, 0x44, 0xbf, 0xc7, 0xa2, 0x2f, 0xa8, 0x4a, 0x5c, 0x74, 0x8e, + 0x5f, 0x45, 0xb9, 0x67, 0x9f, 0x7e, 0x5b, 0xd8, 0xd1, 0x3f, 0x80, 0x51, 0x93, 0xbc, 0x32, 0x8e, + 0xea, 0x1e, 0x7e, 0x0f, 0x70, 0xc1, 0xce, 0x10, 0xc7, 0xa1, 0x4e, 0xc6, 0x11, 0xef, 0xca, 0xe3, + 0x1c, 0x64, 0x95, 0xfb, 0x8b, 0x9a, 0x49, 0x5e, 0x59, 0xb6, 0xc5, 0xbf, 0xe2, 0x84, 0x3e, 0x2d, + 0x15, 0x7d, 0x74, 0x3b, 0xf0, 0xcb, 0xf1, 0x90, 0xe5, 0x20, 0xc1, 0x3e, 0xf0, 0xbc, 0xf3, 0x5f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x28, 0x17, 0xf3, 0x8a, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/vendor/github.com/percona/pmm/api/qanpb/metrics.pb.go b/vendor/github.com/percona/pmm/api/qanpb/metrics.pb.go deleted file mode 100644 index 77cd3c7955..0000000000 --- a/vendor/github.com/percona/pmm/api/qanpb/metrics.pb.go +++ /dev/null @@ -1,415 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: qanpb/metrics.proto - -package qanpb - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// MetricsRequest defines filtering of metrics for specific value of dimention (ex.: host=hostname1 or queryid=1D410B4BE5060972. -type MetricsRequest struct { - PeriodStartFrom *timestamp.Timestamp `protobuf:"bytes,1,opt,name=period_start_from,json=periodStartFrom,proto3" json:"period_start_from,omitempty"` - PeriodStartTo *timestamp.Timestamp `protobuf:"bytes,2,opt,name=period_start_to,json=periodStartTo,proto3" json:"period_start_to,omitempty"` - FilterBy string `protobuf:"bytes,3,opt,name=filter_by,json=filterBy,proto3" json:"filter_by,omitempty"` - GroupBy string `protobuf:"bytes,4,opt,name=group_by,json=groupBy,proto3" json:"group_by,omitempty"` - Labels []*MapFieldEntry `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty"` - IncludeOnlyFields []string `protobuf:"bytes,6,rep,name=include_only_fields,json=includeOnlyFields,proto3" json:"include_only_fields,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MetricsRequest) Reset() { *m = MetricsRequest{} } -func (m *MetricsRequest) String() string { return proto.CompactTextString(m) } -func (*MetricsRequest) ProtoMessage() {} -func (*MetricsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4d1582d9b086d4b7, []int{0} -} - -func (m *MetricsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MetricsRequest.Unmarshal(m, b) -} -func (m *MetricsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MetricsRequest.Marshal(b, m, deterministic) -} -func (m *MetricsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricsRequest.Merge(m, src) -} -func (m *MetricsRequest) XXX_Size() int { - return xxx_messageInfo_MetricsRequest.Size(m) -} -func (m *MetricsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MetricsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricsRequest proto.InternalMessageInfo - -func (m *MetricsRequest) GetPeriodStartFrom() *timestamp.Timestamp { - if m != nil { - return m.PeriodStartFrom - } - return nil -} - -func (m *MetricsRequest) GetPeriodStartTo() *timestamp.Timestamp { - if m != nil { - return m.PeriodStartTo - } - return nil -} - -func (m *MetricsRequest) GetFilterBy() string { - if m != nil { - return m.FilterBy - } - return "" -} - -func (m *MetricsRequest) GetGroupBy() string { - if m != nil { - return m.GroupBy - } - return "" -} - -func (m *MetricsRequest) GetLabels() []*MapFieldEntry { - if m != nil { - return m.Labels - } - return nil -} - -func (m *MetricsRequest) GetIncludeOnlyFields() []string { - if m != nil { - return m.IncludeOnlyFields - } - return nil -} - -// MapFieldEntry allows to pass labels/dimentions in form like {"d_server": ["db1", "db2"...]}. -type MapFieldEntry struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MapFieldEntry) Reset() { *m = MapFieldEntry{} } -func (m *MapFieldEntry) String() string { return proto.CompactTextString(m) } -func (*MapFieldEntry) ProtoMessage() {} -func (*MapFieldEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_4d1582d9b086d4b7, []int{1} -} - -func (m *MapFieldEntry) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MapFieldEntry.Unmarshal(m, b) -} -func (m *MapFieldEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MapFieldEntry.Marshal(b, m, deterministic) -} -func (m *MapFieldEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_MapFieldEntry.Merge(m, src) -} -func (m *MapFieldEntry) XXX_Size() int { - return xxx_messageInfo_MapFieldEntry.Size(m) -} -func (m *MapFieldEntry) XXX_DiscardUnknown() { - xxx_messageInfo_MapFieldEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_MapFieldEntry proto.InternalMessageInfo - -func (m *MapFieldEntry) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *MapFieldEntry) GetValue() []string { - if m != nil { - return m.Value - } - return nil -} - -// MetricsReply defines metrics for specific value of dimention (ex.: host=hostname1 or queryid=1D410B4BE5060972. -type MetricsReply struct { - Metrics map[string]*MetricValues `protobuf:"bytes,3,rep,name=metrics,proto3" json:"metrics,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MetricsReply) Reset() { *m = MetricsReply{} } -func (m *MetricsReply) String() string { return proto.CompactTextString(m) } -func (*MetricsReply) ProtoMessage() {} -func (*MetricsReply) Descriptor() ([]byte, []int) { - return fileDescriptor_4d1582d9b086d4b7, []int{2} -} - -func (m *MetricsReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MetricsReply.Unmarshal(m, b) -} -func (m *MetricsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MetricsReply.Marshal(b, m, deterministic) -} -func (m *MetricsReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricsReply.Merge(m, src) -} -func (m *MetricsReply) XXX_Size() int { - return xxx_messageInfo_MetricsReply.Size(m) -} -func (m *MetricsReply) XXX_DiscardUnknown() { - xxx_messageInfo_MetricsReply.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricsReply proto.InternalMessageInfo - -func (m *MetricsReply) GetMetrics() map[string]*MetricValues { - if m != nil { - return m.Metrics - } - return nil -} - -// MetricValues is statistics of specific metric. -type MetricValues struct { - Rate float32 `protobuf:"fixed32,1,opt,name=rate,proto3" json:"rate,omitempty"` - Cnt float32 `protobuf:"fixed32,2,opt,name=cnt,proto3" json:"cnt,omitempty"` - Sum float32 `protobuf:"fixed32,3,opt,name=sum,proto3" json:"sum,omitempty"` - Min float32 `protobuf:"fixed32,4,opt,name=min,proto3" json:"min,omitempty"` - Max float32 `protobuf:"fixed32,5,opt,name=max,proto3" json:"max,omitempty"` - Avg float32 `protobuf:"fixed32,6,opt,name=avg,proto3" json:"avg,omitempty"` - P99 float32 `protobuf:"fixed32,7,opt,name=p99,proto3" json:"p99,omitempty"` - PTotal float32 `protobuf:"fixed32,8,opt,name=p_total,json=pTotal,proto3" json:"p_total,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MetricValues) Reset() { *m = MetricValues{} } -func (m *MetricValues) String() string { return proto.CompactTextString(m) } -func (*MetricValues) ProtoMessage() {} -func (*MetricValues) Descriptor() ([]byte, []int) { - return fileDescriptor_4d1582d9b086d4b7, []int{3} -} - -func (m *MetricValues) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MetricValues.Unmarshal(m, b) -} -func (m *MetricValues) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MetricValues.Marshal(b, m, deterministic) -} -func (m *MetricValues) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricValues.Merge(m, src) -} -func (m *MetricValues) XXX_Size() int { - return xxx_messageInfo_MetricValues.Size(m) -} -func (m *MetricValues) XXX_DiscardUnknown() { - xxx_messageInfo_MetricValues.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricValues proto.InternalMessageInfo - -func (m *MetricValues) GetRate() float32 { - if m != nil { - return m.Rate - } - return 0 -} - -func (m *MetricValues) GetCnt() float32 { - if m != nil { - return m.Cnt - } - return 0 -} - -func (m *MetricValues) GetSum() float32 { - if m != nil { - return m.Sum - } - return 0 -} - -func (m *MetricValues) GetMin() float32 { - if m != nil { - return m.Min - } - return 0 -} - -func (m *MetricValues) GetMax() float32 { - if m != nil { - return m.Max - } - return 0 -} - -func (m *MetricValues) GetAvg() float32 { - if m != nil { - return m.Avg - } - return 0 -} - -func (m *MetricValues) GetP99() float32 { - if m != nil { - return m.P99 - } - return 0 -} - -func (m *MetricValues) GetPTotal() float32 { - if m != nil { - return m.PTotal - } - return 0 -} - -func init() { - proto.RegisterType((*MetricsRequest)(nil), "qan.MetricsRequest") - proto.RegisterType((*MapFieldEntry)(nil), "qan.MapFieldEntry") - proto.RegisterType((*MetricsReply)(nil), "qan.MetricsReply") - proto.RegisterMapType((map[string]*MetricValues)(nil), "qan.MetricsReply.MetricsEntry") - proto.RegisterType((*MetricValues)(nil), "qan.MetricValues") -} - -func init() { proto.RegisterFile("qanpb/metrics.proto", fileDescriptor_4d1582d9b086d4b7) } - -var fileDescriptor_4d1582d9b086d4b7 = []byte{ - // 588 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xd1, 0x6e, 0xd3, 0x3c, - 0x14, 0x56, 0xd3, 0xb5, 0x59, 0xbd, 0x7f, 0xff, 0xa8, 0x8b, 0x84, 0x09, 0x68, 0x44, 0x01, 0x89, - 0x6a, 0x62, 0x89, 0x18, 0x17, 0xac, 0xbb, 0x5b, 0xa5, 0x6d, 0x57, 0x13, 0xc2, 0x54, 0x5c, 0x70, - 0x13, 0xb9, 0xad, 0x13, 0x45, 0x38, 0xb6, 0x6b, 0x3b, 0x65, 0xb9, 0xe5, 0x11, 0xe0, 0x82, 0x47, - 0xe0, 0x96, 0x77, 0xe1, 0x15, 0x78, 0x10, 0x64, 0x27, 0x1d, 0x9b, 0x26, 0xc4, 0x55, 0xce, 0xf9, - 0xce, 0xe7, 0xef, 0x7c, 0x39, 0xc7, 0x06, 0xa3, 0x15, 0xe1, 0x72, 0x9e, 0x94, 0xd4, 0xa8, 0x62, - 0xa1, 0x63, 0xa9, 0x84, 0x11, 0xb0, 0xbb, 0x22, 0x3c, 0x78, 0x9c, 0x0b, 0x91, 0x33, 0x9a, 0x10, - 0x59, 0x24, 0x84, 0x73, 0x61, 0x88, 0x29, 0x04, 0x6f, 0x29, 0xc1, 0x93, 0xb6, 0xea, 0xb2, 0x79, - 0x95, 0x25, 0xa6, 0x28, 0xa9, 0x36, 0xa4, 0x94, 0x2d, 0xe1, 0x85, 0xfb, 0x2c, 0x0e, 0x73, 0xca, - 0x0f, 0xf5, 0x27, 0x92, 0xe7, 0x54, 0x25, 0x42, 0x3a, 0x89, 0xbb, 0x72, 0xd1, 0x0f, 0x0f, 0xfc, - 0x7f, 0xd9, 0x78, 0xc0, 0x74, 0x55, 0x51, 0x6d, 0xe0, 0x39, 0x18, 0x4a, 0xaa, 0x0a, 0xb1, 0x4c, - 0xb5, 0x21, 0xca, 0xa4, 0x99, 0x12, 0x25, 0xea, 0x84, 0x9d, 0xf1, 0xce, 0x51, 0x10, 0x37, 0xdd, - 0xe3, 0x4d, 0xf7, 0x78, 0xb6, 0xe9, 0x8e, 0xf7, 0x9a, 0x43, 0xef, 0xec, 0x99, 0x73, 0x25, 0x4a, - 0x38, 0x05, 0x7b, 0xb7, 0x74, 0x8c, 0x40, 0xde, 0x3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f, 0xc5, 0x26, 0xf3, 0x03, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MetricsClient is the client API for Metrics service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MetricsClient interface { - // GetMetrics gets map of metrics for specific filtering. - GetMetrics(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*MetricsReply, error) -} - -type metricsClient struct { - cc *grpc.ClientConn -} - -func NewMetricsClient(cc *grpc.ClientConn) MetricsClient { - return &metricsClient{cc} -} - -func (c *metricsClient) GetMetrics(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*MetricsReply, error) { - out := new(MetricsReply) - err := c.cc.Invoke(ctx, "/qan.Metrics/GetMetrics", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MetricsServer is the server API for Metrics service. -type MetricsServer interface { - // GetMetrics gets map of metrics for specific filtering. - GetMetrics(context.Context, *MetricsRequest) (*MetricsReply, error) -} - -func RegisterMetricsServer(s *grpc.Server, srv MetricsServer) { - s.RegisterService(&_Metrics_serviceDesc, srv) -} - -func _Metrics_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MetricsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricsServer).GetMetrics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/qan.Metrics/GetMetrics", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricsServer).GetMetrics(ctx, req.(*MetricsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Metrics_serviceDesc = grpc.ServiceDesc{ - ServiceName: "qan.Metrics", - HandlerType: (*MetricsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetMetrics", - Handler: _Metrics_GetMetrics_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "qanpb/metrics.proto", -} diff --git a/vendor/github.com/percona/pmm/api/qanpb/metrics.pb.gw.go b/vendor/github.com/percona/pmm/api/qanpb/metrics.pb.gw.go deleted file mode 100644 index 7cfb24115f..0000000000 --- a/vendor/github.com/percona/pmm/api/qanpb/metrics.pb.gw.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: qanpb/metrics.proto - -/* -Package qanpb is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package qanpb - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray - -func request_Metrics_GetMetrics_0(ctx context.Context, marshaler runtime.Marshaler, client MetricsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MetricsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetMetrics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -// RegisterMetricsHandlerFromEndpoint is same as RegisterMetricsHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMetricsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMetricsHandler(ctx, mux, conn) -} - -// RegisterMetricsHandler registers the http handlers for service Metrics to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMetricsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMetricsHandlerClient(ctx, mux, NewMetricsClient(conn)) -} - -// RegisterMetricsHandlerClient registers the http handlers for service Metrics -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MetricsClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MetricsClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MetricsClient" to call the correct interceptors. -func RegisterMetricsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MetricsClient) error { - - mux.Handle("POST", pattern_Metrics_GetMetrics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Metrics_GetMetrics_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Metrics_GetMetrics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Metrics_GetMetrics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "qan", "Metrics", "Get"}, "")) -) - -var ( - forward_Metrics_GetMetrics_0 = runtime.ForwardResponseMessage -) diff --git a/vendor/github.com/percona/pmm/api/qanpb/object_details.pb.go b/vendor/github.com/percona/pmm/api/qanpb/object_details.pb.go new file mode 100644 index 0000000000..45ca71de70 --- /dev/null +++ b/vendor/github.com/percona/pmm/api/qanpb/object_details.pb.go @@ -0,0 +1,709 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: qanpb/object_details.proto + +package qanpb + +import ( + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" + _ "github.com/mwitkow/go-proto-validators" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// MetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. +type MetricsRequest struct { + PeriodStartFrom *timestamp.Timestamp `protobuf:"bytes,1,opt,name=period_start_from,json=periodStartFrom,proto3" json:"period_start_from,omitempty"` + PeriodStartTo *timestamp.Timestamp `protobuf:"bytes,2,opt,name=period_start_to,json=periodStartTo,proto3" json:"period_start_to,omitempty"` + // dimension value: ex: queryid - 1D410B4BE5060972. + FilterBy string `protobuf:"bytes,3,opt,name=filter_by,json=filterBy,proto3" json:"filter_by,omitempty"` + // one of dimension: queryid | host ... + GroupBy string `protobuf:"bytes,4,opt,name=group_by,json=groupBy,proto3" json:"group_by,omitempty"` + Labels []*MapFieldEntry `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty"` + IncludeOnlyFields []string `protobuf:"bytes,6,rep,name=include_only_fields,json=includeOnlyFields,proto3" json:"include_only_fields,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MetricsRequest) Reset() { *m = MetricsRequest{} } +func (m *MetricsRequest) String() string { return proto.CompactTextString(m) } +func (*MetricsRequest) ProtoMessage() {} +func (*MetricsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_173f4868b35b4ff7, []int{0} +} + +func (m *MetricsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MetricsRequest.Unmarshal(m, b) +} +func (m *MetricsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MetricsRequest.Marshal(b, m, deterministic) +} +func (m *MetricsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MetricsRequest.Merge(m, src) +} +func (m *MetricsRequest) XXX_Size() int { + return xxx_messageInfo_MetricsRequest.Size(m) +} +func (m *MetricsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MetricsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MetricsRequest proto.InternalMessageInfo + +func (m *MetricsRequest) GetPeriodStartFrom() *timestamp.Timestamp { + if m != nil { + return m.PeriodStartFrom + } + return nil +} + +func (m *MetricsRequest) GetPeriodStartTo() *timestamp.Timestamp { + if m != nil { + return m.PeriodStartTo + } + return nil +} + +func (m *MetricsRequest) GetFilterBy() string { + if m != nil { + return m.FilterBy + } + return "" +} + +func (m *MetricsRequest) GetGroupBy() string { + if m != nil { + return m.GroupBy + } + return "" +} + +func (m *MetricsRequest) GetLabels() []*MapFieldEntry { + if m != nil { + return m.Labels + } + return nil +} + +func (m *MetricsRequest) GetIncludeOnlyFields() []string { + if m != nil { + return m.IncludeOnlyFields + } + return nil +} + +// MapFieldEntry allows to pass labels/dimensions in form like {"d_server": ["db1", "db2"...]}. +type MapFieldEntry struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MapFieldEntry) Reset() { *m = MapFieldEntry{} } +func (m *MapFieldEntry) String() string { return proto.CompactTextString(m) } +func (*MapFieldEntry) ProtoMessage() {} +func (*MapFieldEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_173f4868b35b4ff7, []int{1} +} + +func (m *MapFieldEntry) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MapFieldEntry.Unmarshal(m, b) +} +func (m *MapFieldEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MapFieldEntry.Marshal(b, m, deterministic) +} +func (m *MapFieldEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_MapFieldEntry.Merge(m, src) +} +func (m *MapFieldEntry) XXX_Size() int { + return xxx_messageInfo_MapFieldEntry.Size(m) +} +func (m *MapFieldEntry) XXX_DiscardUnknown() { + xxx_messageInfo_MapFieldEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_MapFieldEntry proto.InternalMessageInfo + +func (m *MapFieldEntry) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *MapFieldEntry) GetValue() []string { + if m != nil { + return m.Value + } + return nil +} + +// MetricsReply defines metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. +type MetricsReply struct { + Metrics map[string]*MetricValues `protobuf:"bytes,3,rep,name=metrics,proto3" json:"metrics,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MetricsReply) Reset() { *m = MetricsReply{} } +func (m *MetricsReply) String() string { return proto.CompactTextString(m) } +func (*MetricsReply) ProtoMessage() {} +func (*MetricsReply) Descriptor() ([]byte, []int) { + return fileDescriptor_173f4868b35b4ff7, []int{2} +} + +func (m *MetricsReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MetricsReply.Unmarshal(m, b) +} +func (m *MetricsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MetricsReply.Marshal(b, m, deterministic) +} +func (m *MetricsReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_MetricsReply.Merge(m, src) +} +func (m *MetricsReply) XXX_Size() int { + return xxx_messageInfo_MetricsReply.Size(m) +} +func (m *MetricsReply) XXX_DiscardUnknown() { + xxx_messageInfo_MetricsReply.DiscardUnknown(m) +} + +var xxx_messageInfo_MetricsReply proto.InternalMessageInfo + +func (m *MetricsReply) GetMetrics() map[string]*MetricValues { + if m != nil { + return m.Metrics + } + return nil +} + +// MetricValues is statistics of specific metric. +type MetricValues struct { + Rate float32 `protobuf:"fixed32,1,opt,name=rate,proto3" json:"rate,omitempty"` + Cnt float32 `protobuf:"fixed32,2,opt,name=cnt,proto3" json:"cnt,omitempty"` + Sum float32 `protobuf:"fixed32,3,opt,name=sum,proto3" json:"sum,omitempty"` + Min float32 `protobuf:"fixed32,4,opt,name=min,proto3" json:"min,omitempty"` + Max float32 `protobuf:"fixed32,5,opt,name=max,proto3" json:"max,omitempty"` + Avg float32 `protobuf:"fixed32,6,opt,name=avg,proto3" json:"avg,omitempty"` + P99 float32 `protobuf:"fixed32,7,opt,name=p99,proto3" json:"p99,omitempty"` + PercentOfTotal float32 `protobuf:"fixed32,8,opt,name=percent_of_total,json=percentOfTotal,proto3" json:"percent_of_total,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MetricValues) Reset() { *m = MetricValues{} } +func (m *MetricValues) String() string { return proto.CompactTextString(m) } +func (*MetricValues) ProtoMessage() {} +func (*MetricValues) Descriptor() ([]byte, []int) { + return fileDescriptor_173f4868b35b4ff7, []int{3} +} + +func (m *MetricValues) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MetricValues.Unmarshal(m, b) +} +func (m *MetricValues) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MetricValues.Marshal(b, m, deterministic) +} +func (m *MetricValues) XXX_Merge(src proto.Message) { + xxx_messageInfo_MetricValues.Merge(m, src) +} +func (m *MetricValues) XXX_Size() int { + return xxx_messageInfo_MetricValues.Size(m) +} +func (m *MetricValues) XXX_DiscardUnknown() { + xxx_messageInfo_MetricValues.DiscardUnknown(m) +} + +var xxx_messageInfo_MetricValues proto.InternalMessageInfo + +func (m *MetricValues) GetRate() float32 { + if m != nil { + return m.Rate + } + return 0 +} + +func (m *MetricValues) GetCnt() float32 { + if m != nil { + return m.Cnt + } + return 0 +} + +func (m *MetricValues) GetSum() float32 { + if m != nil { + return m.Sum + } + return 0 +} + +func (m *MetricValues) GetMin() float32 { + if m != nil { + return m.Min + } + return 0 +} + +func (m *MetricValues) GetMax() float32 { + if m != nil { + return m.Max + } + return 0 +} + +func (m *MetricValues) GetAvg() float32 { + if m != nil { + return m.Avg + } + return 0 +} + +func (m *MetricValues) GetP99() float32 { + if m != nil { + return m.P99 + } + return 0 +} + +func (m *MetricValues) GetPercentOfTotal() float32 { + if m != nil { + return m.PercentOfTotal + } + return 0 +} + +// Labels are list of labels or dimensions values. +type Labels struct { + Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Labels) Reset() { *m = Labels{} } +func (m *Labels) String() string { return proto.CompactTextString(m) } +func (*Labels) ProtoMessage() {} +func (*Labels) Descriptor() ([]byte, []int) { + return fileDescriptor_173f4868b35b4ff7, []int{4} +} + +func (m *Labels) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Labels.Unmarshal(m, b) +} +func (m *Labels) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Labels.Marshal(b, m, deterministic) +} +func (m *Labels) XXX_Merge(src proto.Message) { + xxx_messageInfo_Labels.Merge(m, src) +} +func (m *Labels) XXX_Size() int { + return xxx_messageInfo_Labels.Size(m) +} +func (m *Labels) XXX_DiscardUnknown() { + xxx_messageInfo_Labels.DiscardUnknown(m) +} + +var xxx_messageInfo_Labels proto.InternalMessageInfo + +func (m *Labels) GetValue() []string { + if m != nil { + return m.Value + } + return nil +} + +// QueryExampleRequest defines filtering of query examples for specific value of +// dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. +type QueryExampleRequest struct { + PeriodStartFrom *timestamp.Timestamp `protobuf:"bytes,1,opt,name=period_start_from,json=periodStartFrom,proto3" json:"period_start_from,omitempty"` + PeriodStartTo *timestamp.Timestamp `protobuf:"bytes,2,opt,name=period_start_to,json=periodStartTo,proto3" json:"period_start_to,omitempty"` + // dimension value: ex: queryid - 1D410B4BE5060972. + FilterBy string `protobuf:"bytes,3,opt,name=filter_by,json=filterBy,proto3" json:"filter_by,omitempty"` + // one of dimension: queryid | host ... + GroupBy string `protobuf:"bytes,4,opt,name=group_by,json=groupBy,proto3" json:"group_by,omitempty"` + Labels []*MapFieldEntry `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty"` + Limit uint32 `protobuf:"varint,6,opt,name=limit,proto3" json:"limit,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QueryExampleRequest) Reset() { *m = QueryExampleRequest{} } +func (m *QueryExampleRequest) String() string { return proto.CompactTextString(m) } +func (*QueryExampleRequest) ProtoMessage() {} +func (*QueryExampleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_173f4868b35b4ff7, []int{5} +} + +func (m *QueryExampleRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QueryExampleRequest.Unmarshal(m, b) +} +func (m *QueryExampleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QueryExampleRequest.Marshal(b, m, deterministic) +} +func (m *QueryExampleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExampleRequest.Merge(m, src) +} +func (m *QueryExampleRequest) XXX_Size() int { + return xxx_messageInfo_QueryExampleRequest.Size(m) +} +func (m *QueryExampleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExampleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExampleRequest proto.InternalMessageInfo + +func (m *QueryExampleRequest) GetPeriodStartFrom() *timestamp.Timestamp { + if m != nil { + return m.PeriodStartFrom + } + return nil +} + +func (m *QueryExampleRequest) GetPeriodStartTo() *timestamp.Timestamp { + if m != nil { + return m.PeriodStartTo + } + return nil +} + +func (m *QueryExampleRequest) GetFilterBy() string { + if m != nil { + return m.FilterBy + } + return "" +} + +func (m *QueryExampleRequest) GetGroupBy() string { + if m != nil { + return m.GroupBy + } + return "" +} + +func (m *QueryExampleRequest) GetLabels() []*MapFieldEntry { + if m != nil { + return m.Labels + } + return nil +} + +func (m *QueryExampleRequest) GetLimit() uint32 { + if m != nil { + return m.Limit + } + return 0 +} + +// QueryExampleReply list of query examples. +type QueryExampleReply struct { + QueryExamples []*QueryExample `protobuf:"bytes,1,rep,name=query_examples,json=queryExamples,proto3" json:"query_examples,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QueryExampleReply) Reset() { *m = QueryExampleReply{} } +func (m *QueryExampleReply) String() string { return proto.CompactTextString(m) } +func (*QueryExampleReply) ProtoMessage() {} +func (*QueryExampleReply) Descriptor() ([]byte, []int) { + return fileDescriptor_173f4868b35b4ff7, []int{6} +} + +func (m *QueryExampleReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QueryExampleReply.Unmarshal(m, b) +} +func (m *QueryExampleReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QueryExampleReply.Marshal(b, m, deterministic) +} +func (m *QueryExampleReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExampleReply.Merge(m, src) +} +func (m *QueryExampleReply) XXX_Size() int { + return xxx_messageInfo_QueryExampleReply.Size(m) +} +func (m *QueryExampleReply) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExampleReply.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExampleReply proto.InternalMessageInfo + +func (m *QueryExampleReply) GetQueryExamples() []*QueryExample { + if m != nil { + return m.QueryExamples + } + return nil +} + +// QueryExample shows query examples and their metrics. +type QueryExample struct { + Example string `protobuf:"bytes,1,opt,name=example,proto3" json:"example,omitempty"` + ExampleFormat ExampleFormat `protobuf:"varint,2,opt,name=example_format,json=exampleFormat,proto3,enum=qan.ExampleFormat" json:"example_format,omitempty"` + ExampleType ExampleType `protobuf:"varint,3,opt,name=example_type,json=exampleType,proto3,enum=qan.ExampleType" json:"example_type,omitempty"` + IsTruncated uint32 `protobuf:"varint,4,opt,name=is_truncated,json=isTruncated,proto3" json:"is_truncated,omitempty"` + ExampleMetrics string `protobuf:"bytes,5,opt,name=example_metrics,json=exampleMetrics,proto3" json:"example_metrics,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QueryExample) Reset() { *m = QueryExample{} } +func (m *QueryExample) String() string { return proto.CompactTextString(m) } +func (*QueryExample) ProtoMessage() {} +func (*QueryExample) Descriptor() ([]byte, []int) { + return fileDescriptor_173f4868b35b4ff7, []int{7} +} + +func (m *QueryExample) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QueryExample.Unmarshal(m, b) +} +func (m *QueryExample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QueryExample.Marshal(b, m, deterministic) +} +func (m *QueryExample) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExample.Merge(m, src) +} +func (m *QueryExample) XXX_Size() int { + return xxx_messageInfo_QueryExample.Size(m) +} +func (m *QueryExample) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExample.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExample proto.InternalMessageInfo + +func (m *QueryExample) GetExample() string { + if m != nil { + return m.Example + } + return "" +} + +func (m *QueryExample) GetExampleFormat() ExampleFormat { + if m != nil { + return m.ExampleFormat + } + return ExampleFormat_EXAMPLE_FORMAT_INVALID +} + +func (m *QueryExample) GetExampleType() ExampleType { + if m != nil { + return m.ExampleType + } + return ExampleType_EXAMPLE_TYPE_INVALID +} + +func (m *QueryExample) GetIsTruncated() uint32 { + if m != nil { + return m.IsTruncated + } + return 0 +} + +func (m *QueryExample) GetExampleMetrics() string { + if m != nil { + return m.ExampleMetrics + } + return "" +} + +func init() { + proto.RegisterType((*MetricsRequest)(nil), "qan.MetricsRequest") + proto.RegisterType((*MapFieldEntry)(nil), "qan.MapFieldEntry") + proto.RegisterType((*MetricsReply)(nil), "qan.MetricsReply") + proto.RegisterMapType((map[string]*MetricValues)(nil), "qan.MetricsReply.MetricsEntry") + proto.RegisterType((*MetricValues)(nil), "qan.MetricValues") + proto.RegisterType((*Labels)(nil), "qan.Labels") + proto.RegisterType((*QueryExampleRequest)(nil), "qan.QueryExampleRequest") + proto.RegisterType((*QueryExampleReply)(nil), "qan.QueryExampleReply") + proto.RegisterType((*QueryExample)(nil), "qan.QueryExample") +} + +func init() { proto.RegisterFile("qanpb/object_details.proto", fileDescriptor_173f4868b35b4ff7) } + +var fileDescriptor_173f4868b35b4ff7 = []byte{ + // 852 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x55, 0x41, 0x6e, 0xe3, 0x36, + 0x17, 0x86, 0xe4, 0xb1, 0x9d, 0x30, 0xb1, 0x1d, 0x33, 0x83, 0x1f, 0xfa, 0xdd, 0x62, 0xea, 0xaa, + 0x1d, 0x8c, 0x91, 0x36, 0x56, 0x9b, 0x01, 0xda, 0x71, 0x76, 0x13, 0x34, 0xc9, 0xa6, 0x41, 0x30, + 0xaa, 0xd1, 0x45, 0x37, 0x02, 0x6d, 0x3f, 0xa9, 0xec, 0x48, 0xa4, 0x4c, 0x52, 0x4e, 0xb4, 0xed, + 0x11, 0xda, 0x45, 0x17, 0xbd, 0x44, 0x97, 0xbd, 0x47, 0xaf, 0x30, 0x9b, 0xde, 0xa2, 0x20, 0x29, + 0x39, 0x32, 0x66, 0x06, 0x3d, 0x40, 0x57, 0x7e, 0xef, 0x7b, 0xef, 0x7d, 0xfc, 0xf4, 0x91, 0x34, + 0xd1, 0x68, 0x4d, 0x58, 0xbe, 0x08, 0xf8, 0xe2, 0x27, 0x58, 0xaa, 0x68, 0x05, 0x8a, 0xd0, 0x54, + 0x4e, 0x73, 0xc1, 0x15, 0xc7, 0xad, 0x35, 0x61, 0xa3, 0xaf, 0x12, 0xaa, 0x7e, 0x2c, 0x16, 0xd3, + 0x25, 0xcf, 0x82, 0xec, 0x8e, 0xaa, 0xd7, 0xfc, 0x2e, 0x48, 0xf8, 0xa9, 0xe9, 0x38, 0xdd, 0x90, + 0x94, 0xae, 0x88, 0xe2, 0x42, 0x06, 0xdb, 0xd0, 0x0e, 0x8f, 0x3e, 0x4c, 0x38, 0x4f, 0x52, 0x08, + 0x48, 0x4e, 0x03, 0xc2, 0x18, 0x57, 0x44, 0x51, 0xce, 0x2a, 0xea, 0xd1, 0x47, 0x55, 0xd5, 0x64, + 0x8b, 0x22, 0x0e, 0x14, 0xcd, 0x40, 0x2a, 0x92, 0xe5, 0x55, 0xc3, 0xe7, 0xe6, 0x67, 0x79, 0x9a, + 0x00, 0x3b, 0x95, 0x77, 0x24, 0x49, 0x40, 0x04, 0x3c, 0x37,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x9d, 0x13, 0x5c, 0xa0, 0xc1, + 0x35, 0xa8, 0x5d, 0x77, 0xdf, 0xde, 0x90, 0x6a, 0xb1, 0xff, 0xbd, 0xa3, 0xa2, 0x57, 0xfc, 0xc2, + 0xac, 0x78, 0xe2, 0x3f, 0x7d, 0xef, 0x8a, 0xcd, 0x99, 0x73, 0xe7, 0xe4, 0xe2, 0xd5, 0x2f, 0x2f, + 0xaf, 0xc3, 0x4b, 0xd4, 0x5d, 0x41, 0x4c, 0x8a, 0x54, 0xe1, 0x73, 0x84, 0x5f, 0xb2, 0x31, 0x08, + 0xc1, 0xc5, 0x58, 0x80, 0xcc, 0x39, 0x93, 0x30, 0xc5, 0x9f, 0x22, 0x7f, 0x34, 0xfe, 0x24, 0x58, + 0x41, 0x4c, 0x19, 0xb5, 0x8f, 0x8f, 0x79, 0x69, 0x2e, 0x75, 0x5f, 0x58, 0xb5, 0xfd, 0xd0, 0x36, + 0xd8, 0xa2, 0x63, 0x6e, 0xc4, 0xf3, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x3c, 0xae, 0x8b, + 0x53, 0x07, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// ObjectDetailsClient is the client API for ObjectDetails service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ObjectDetailsClient interface { + // GetMetrics gets map of metrics for specific filtering. + GetMetrics(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*MetricsReply, error) + // GetQueryExample gets list of query examples. + GetQueryExample(ctx context.Context, in *QueryExampleRequest, opts ...grpc.CallOption) (*QueryExampleReply, error) +} + +type objectDetailsClient struct { + cc *grpc.ClientConn +} + +func NewObjectDetailsClient(cc *grpc.ClientConn) ObjectDetailsClient { + return &objectDetailsClient{cc} +} + +func (c *objectDetailsClient) GetMetrics(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*MetricsReply, error) { + out := new(MetricsReply) + err := c.cc.Invoke(ctx, "/qan.ObjectDetails/GetMetrics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectDetailsClient) GetQueryExample(ctx context.Context, in *QueryExampleRequest, opts ...grpc.CallOption) (*QueryExampleReply, error) { + out := new(QueryExampleReply) + err := c.cc.Invoke(ctx, "/qan.ObjectDetails/GetQueryExample", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ObjectDetailsServer is the server API for ObjectDetails service. +type ObjectDetailsServer interface { + // GetMetrics gets map of metrics for specific filtering. + GetMetrics(context.Context, *MetricsRequest) (*MetricsReply, error) + // GetQueryExample gets list of query examples. + GetQueryExample(context.Context, *QueryExampleRequest) (*QueryExampleReply, error) +} + +func RegisterObjectDetailsServer(s *grpc.Server, srv ObjectDetailsServer) { + s.RegisterService(&_ObjectDetails_serviceDesc, srv) +} + +func _ObjectDetails_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MetricsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectDetailsServer).GetMetrics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/qan.ObjectDetails/GetMetrics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectDetailsServer).GetMetrics(ctx, req.(*MetricsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectDetails_GetQueryExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryExampleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectDetailsServer).GetQueryExample(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/qan.ObjectDetails/GetQueryExample", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectDetailsServer).GetQueryExample(ctx, req.(*QueryExampleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ObjectDetails_serviceDesc = grpc.ServiceDesc{ + ServiceName: "qan.ObjectDetails", + HandlerType: (*ObjectDetailsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetMetrics", + Handler: _ObjectDetails_GetMetrics_Handler, + }, + { + MethodName: "GetQueryExample", + Handler: _ObjectDetails_GetQueryExample_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "qanpb/object_details.proto", +} diff --git a/vendor/github.com/percona/pmm/api/qanpb/object_details.pb.gw.go b/vendor/github.com/percona/pmm/api/qanpb/object_details.pb.gw.go new file mode 100644 index 0000000000..0708fc39b4 --- /dev/null +++ b/vendor/github.com/percona/pmm/api/qanpb/object_details.pb.gw.go @@ -0,0 +1,156 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: qanpb/object_details.proto + +/* +Package qanpb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package qanpb + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_ObjectDetails_GetMetrics_0(ctx context.Context, marshaler runtime.Marshaler, client ObjectDetailsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MetricsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetMetrics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_ObjectDetails_GetQueryExample_0(ctx context.Context, marshaler runtime.Marshaler, client ObjectDetailsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExampleRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetQueryExample(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterObjectDetailsHandlerFromEndpoint is same as RegisterObjectDetailsHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterObjectDetailsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterObjectDetailsHandler(ctx, mux, conn) +} + +// RegisterObjectDetailsHandler registers the http handlers for service ObjectDetails to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterObjectDetailsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterObjectDetailsHandlerClient(ctx, mux, NewObjectDetailsClient(conn)) +} + +// RegisterObjectDetailsHandlerClient registers the http handlers for service ObjectDetails +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ObjectDetailsClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ObjectDetailsClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ObjectDetailsClient" to call the correct interceptors. +func RegisterObjectDetailsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ObjectDetailsClient) error { + + mux.Handle("POST", pattern_ObjectDetails_GetMetrics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ObjectDetails_GetMetrics_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ObjectDetails_GetMetrics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ObjectDetails_GetQueryExample_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ObjectDetails_GetQueryExample_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ObjectDetails_GetQueryExample_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ObjectDetails_GetMetrics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "qan", "ObjectDetails", "GetMetrics"}, "")) + + pattern_ObjectDetails_GetQueryExample_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "qan", "ObjectDetails", "GetQueryExample"}, "")) +) + +var ( + forward_ObjectDetails_GetMetrics_0 = runtime.ForwardResponseMessage + + forward_ObjectDetails_GetQueryExample_0 = runtime.ForwardResponseMessage +) diff --git a/vendor/github.com/percona/pmm/api/qanpb/metrics.validator.pb.go b/vendor/github.com/percona/pmm/api/qanpb/object_details.validator.pb.go similarity index 54% rename from vendor/github.com/percona/pmm/api/qanpb/metrics.validator.pb.go rename to vendor/github.com/percona/pmm/api/qanpb/object_details.validator.pb.go index 960056fb80..26e44dd125 100644 --- a/vendor/github.com/percona/pmm/api/qanpb/metrics.validator.pb.go +++ b/vendor/github.com/percona/pmm/api/qanpb/object_details.validator.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: qanpb/metrics.proto +// source: qanpb/object_details.proto package qanpb @@ -8,6 +8,7 @@ import ( proto "github.com/golang/protobuf/proto" _ "github.com/golang/protobuf/ptypes/timestamp" _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" + _ "github.com/mwitkow/go-proto-validators" github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" math "math" @@ -48,3 +49,39 @@ func (this *MetricsReply) Validate() error { func (this *MetricValues) Validate() error { return nil } +func (this *Labels) Validate() error { + return nil +} +func (this *QueryExampleRequest) Validate() error { + if this.PeriodStartFrom != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.PeriodStartFrom); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("PeriodStartFrom", err) + } + } + if this.PeriodStartTo != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.PeriodStartTo); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("PeriodStartTo", err) + } + } + for _, item := range this.Labels { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Labels", err) + } + } + } + return nil +} +func (this *QueryExampleReply) Validate() error { + for _, item := range this.QueryExamples { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("QueryExamples", err) + } + } + } + return nil +} +func (this *QueryExample) Validate() error { + return nil +}