diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 39bdb521..21c99b97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,12 +36,3 @@ jobs: make examples make test make build - - - name: Codecov - uses: codecov/codecov-action@v1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - file: ./acc.out - flags: unittests # optional - name: codecov-umbrella # optional - fail_ci_if_error: true # optional (default = false) diff --git a/Makefile b/Makefile index 1504f1f3..16d768c9 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,7 @@ GITHASH := `git rev-parse HEAD` GITTAG := `git describe --tags --always` LDFLAGS="-X github.com/gobench-io/gobench/master.gitCommit=$(GITHASH) -X github.com/gobench-io/gobench/master.gitTag=$(GITTAG)" -.PHONY: lint build examples ent pb - -pb: - protoc --go_out=. --go_opt=paths=source_relative \ - --go-grpc_out=. --go-grpc_opt=paths=source_relative,require_unimplemented_servers=false \ - pb/agent.proto - protoc --go_out=. --go_opt=paths=source_relative \ - --go-grpc_out=. --go-grpc_opt=paths=source_relative,require_unimplemented_servers=false \ - pb/executor.proto +.PHONY: lint build examples ent .PHONY: gen gen: diff --git a/agent/agent.go b/agent/agent.go index cead9013..24e3fc76 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -13,7 +13,6 @@ import ( api "github.com/gobench-io/gobench/v2/gen/go/pb" "github.com/gobench-io/gobench/v2/logger" - "github.com/gobench-io/gobench/v2/pb" "google.golang.org/grpc" ) @@ -31,7 +30,7 @@ type Agent struct { route string clusterPort int - ml pb.AgentServer + ml api.AgentServer logger logger.Logger executorLogger io.WriteCloser // when running the executor, save log here socket string // unix socket that the agent rpc server will listen at @@ -42,7 +41,7 @@ type Agent struct { heartbeatInterval time.Duration } -func NewLocalAgent(ml pb.AgentServer, logger logger.Logger) (*Agent, error) { +func NewLocalAgent(ml api.AgentServer, logger logger.Logger) (*Agent, error) { a := &Agent{ ml: ml, logger: logger, @@ -53,7 +52,7 @@ func NewLocalAgent(ml pb.AgentServer, logger logger.Logger) (*Agent, error) { // NewAgent create a new agent instance. // Deprecated, use NewAgentV2 instead // todo: remove this in gobench@v2 -func NewAgent(opts *Options, ml pb.AgentServer, logger logger.Logger) (*Agent, error) { +func NewAgent(opts *Options, ml api.AgentServer, logger logger.Logger) (*Agent, error) { a := &Agent{ route: opts.Route, clusterPort: opts.ClusterPort, @@ -64,7 +63,7 @@ func NewAgent(opts *Options, ml pb.AgentServer, logger logger.Logger) (*Agent, e return a, nil } -func NewAgentV2(opts *Options, logger logger.Logger, ml pb.AgentServer, jdsClient api.JobDistributionServiceClient) (*Agent, error) { +func NewAgentV2(opts *Options, logger logger.Logger, ml api.AgentServer, jdsClient api.JobDistributionServiceClient) (*Agent, error) { a := &Agent{ route: opts.Route, clusterPort: opts.ClusterPort, @@ -127,7 +126,7 @@ func (a *Agent) sendHeartbeat(ctx context.Context) error { } // SetMetricLogger sets metric logger property -func (a *Agent) SetMetricLogger(ml pb.AgentServer) { +func (a *Agent) SetMetricLogger(ml api.AgentServer) { a.mu.Lock() a.ml = ml a.mu.Unlock() @@ -160,7 +159,7 @@ func (a *Agent) StartSocketServer() error { return err } s := grpc.NewServer() - pb.RegisterAgentServer(s, a.ml) + api.RegisterAgentServer(s, a.ml) go s.Serve(l) @@ -219,7 +218,7 @@ func (a *Agent) RunJob(ctx context.Context, executorPath string, appID int) (err a.logger.Infow("local executor to run driver") // todo: handle the response - if _, err = client.Start(ctx, &pb.StartRequest{}); err != nil { + if _, err = client.Start(ctx, &api.StartRequest{}); err != nil { err = fmt.Errorf("rpc start: %v", err) return } @@ -227,7 +226,7 @@ func (a *Agent) RunJob(ctx context.Context, executorPath string, appID int) (err a.logger.Infow("local executor is shutting down") // ignore error, since when the executor is terminated, this rpc will fail - _, _ = client.Terminate(ctx, &pb.TermRequest{}) + _, _ = client.Terminate(ctx, &api.TermRequest{}) if err = cmd.Wait(); err != nil { a.logger.Errorw("executor wait", "err", err) @@ -238,7 +237,7 @@ func (a *Agent) RunJob(ctx context.Context, executorPath string, appID int) (err } func waitForReady(ctx context.Context, executorSock string, expiredIn time.Duration) ( - pb.ExecutorClient, error, + api.ExecutorClient, error, ) { timeout := time.After(expiredIn) sleep := 10 * time.Millisecond @@ -256,7 +255,7 @@ func waitForReady(ctx context.Context, executorSock string, expiredIn time.Durat if err != nil { continue } - client := pb.NewExecutorClient(conn) + client := api.NewExecutorClient(conn) return client, nil } } diff --git a/agent/metriclog.go b/agent/metriclog.go index 9fd7cc50..c1273353 100644 --- a/agent/metriclog.go +++ b/agent/metriclog.go @@ -3,33 +3,33 @@ package agent import ( "context" - "github.com/gobench-io/gobench/v2/pb" + api "github.com/gobench-io/gobench/v2/gen/go/pb" ) // nop metric logger type nopLog struct{} -func (n *nopLog) FindCreateGroup(context.Context, *pb.FCGroupReq) (*pb.FCGroupRes, error) { +func (n *nopLog) FindCreateGroup(context.Context, *api.FCGroupReq) (*api.FCGroupRes, error) { return nil, nil } -func (n *nopLog) FindCreateGraph(context.Context, *pb.FCGraphReq) (*pb.FCGraphRes, error) { +func (n *nopLog) FindCreateGraph(context.Context, *api.FCGraphReq) (*api.FCGraphRes, error) { return nil, nil } -func (n *nopLog) FindCreateMetric(context.Context, *pb.FCMetricReq) (*pb.FCMetricRes, error) { +func (n *nopLog) FindCreateMetric(context.Context, *api.FCMetricReq) (*api.FCMetricRes, error) { return nil, nil } -func (n *nopLog) Histogram(context.Context, *pb.HistogramReq) (*pb.HistogramRes, error) { +func (n *nopLog) Histogram(context.Context, *api.HistogramReq) (*api.HistogramRes, error) { return nil, nil } -func (n *nopLog) Counter(context.Context, *pb.CounterReq) (*pb.CounterRes, error) { +func (n *nopLog) Counter(context.Context, *api.CounterReq) (*api.CounterRes, error) { return nil, nil } -func (n *nopLog) Gauge(context.Context, *pb.GaugeReq) (*pb.GaugeRes, error) { +func (n *nopLog) Gauge(context.Context, *api.GaugeReq) (*api.GaugeRes, error) { return nil, nil } diff --git a/executor/executor.go b/executor/executor.go index c1f4e585..93c9bc60 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -12,8 +12,8 @@ import ( "github.com/gobench-io/gobench/v2/dis" "github.com/gobench-io/gobench/v2/executor/metrics" "github.com/gobench-io/gobench/v2/executor/scenario" + api "github.com/gobench-io/gobench/v2/gen/go/pb" "github.com/gobench-io/gobench/v2/logger" - "github.com/gobench-io/gobench/v2/pb" "google.golang.org/grpc" gometrics "github.com/rcrowley/go-metrics" @@ -67,7 +67,7 @@ type Executor struct { vus scenario.Vus units map[string]unit //title - gometrics - rc pb.AgentClient + rc api.AgentClient } // the singleton instance of executor @@ -113,7 +113,7 @@ func (e *Executor) Serve() (err error) { if err != nil { return } - e.rc = pb.NewAgentClient(conn) + e.rc = api.NewAgentClient(conn) // executor register a rpc server at executor socket l, err := net.Listen("unix", e.executorSock) @@ -122,7 +122,7 @@ func (e *Executor) Serve() (err error) { } s := grpc.NewServer() - pb.RegisterExecutorServer(s, e) + api.RegisterExecutorServer(s, e) err = s.Serve(l) if err != nil { @@ -219,7 +219,7 @@ func (e *Executor) logScaledOnCue(ctx context.Context, ch chan interface{}) erro e.mu.Unlock() for _, u := range units { - base := &pb.BasedReqMetric{ + base := &api.BasedReqMetric{ AppID: int64(e.appID), EID: e.id, MID: int64(u.metricID), @@ -228,14 +228,14 @@ func (e *Executor) logScaledOnCue(ctx context.Context, ch chan interface{}) erro switch u.Type { case metrics.Counter: - _, err = e.rc.Counter(ctx, &pb.CounterReq{ + _, err = e.rc.Counter(ctx, &api.CounterReq{ Base: base, Count: u.c.Count(), }) case metrics.Histogram: h := u.h.Snapshot() ps := h.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999}) - hv := &pb.HistogramValues{ + hv := &api.HistogramValues{ Count: h.Count(), Min: h.Min(), Max: h.Max(), @@ -247,12 +247,12 @@ func (e *Executor) logScaledOnCue(ctx context.Context, ch chan interface{}) erro P99: ps[3], P999: ps[4], } - _, err = e.rc.Histogram(ctx, &pb.HistogramReq{ + _, err = e.rc.Histogram(ctx, &api.HistogramReq{ Base: base, Histogram: hv, }) case metrics.Gauge: - _, err = e.rc.Gauge(ctx, &pb.GaugeReq{ + _, err = e.rc.Gauge(ctx, &api.GaugeReq{ Base: base, Gauge: u.g.Value(), }) @@ -284,7 +284,7 @@ func (e *Executor) Setup(groups []metrics.Group) error { for _, group := range groups { // create a new group if not existed - egroup, err := e.rc.FindCreateGroup(ctx, &pb.FCGroupReq{ + egroup, err := e.rc.FindCreateGroup(ctx, &api.FCGroupReq{ AppID: int64(e.appID), Name: group.Name, }) @@ -294,7 +294,7 @@ func (e *Executor) Setup(groups []metrics.Group) error { for _, graph := range group.Graphs { // create new graph if not existed - egraph, err := e.rc.FindCreateGraph(ctx, &pb.FCGraphReq{ + egraph, err := e.rc.FindCreateGraph(ctx, &api.FCGraphReq{ AppID: int64(e.appID), Title: graph.Title, Unit: graph.Unit, @@ -306,7 +306,7 @@ func (e *Executor) Setup(groups []metrics.Group) error { for _, m := range graph.Metrics { // create new metric if not existed - emetric, err := e.rc.FindCreateMetric(ctx, &pb.FCMetricReq{ + emetric, err := e.rc.FindCreateMetric(ctx, &api.FCMetricReq{ AppID: int64(e.appID), Title: m.Title, Type: string(m.Type), diff --git a/executor/executor_test.go b/executor/executor_test.go index 607d4418..04dae6a3 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -11,8 +11,8 @@ import ( "time" "github.com/gobench-io/gobench/v2/executor/scenario" + api "github.com/gobench-io/gobench/v2/gen/go/pb" "github.com/gobench-io/gobench/v2/logger" - "github.com/gobench-io/gobench/v2/pb" "github.com/stretchr/testify/assert" ) @@ -127,7 +127,7 @@ func TestStart(t *testing.T) { ctx := context.TODO() - _, err = e.Start(ctx, &pb.StartRequest{ + _, err = e.Start(ctx, &api.StartRequest{ AppID: int64(opts.AppID), }) @@ -163,7 +163,7 @@ func TestCancel(t *testing.T) { done := make(chan struct{}, 1) go func() { - _, err = e.Start(ctx, &pb.StartRequest{ + _, err = e.Start(ctx, &api.StartRequest{ AppID: int64(opts.AppID), }) assert.EqualError(t, err, ErrAppCancel.Error()) diff --git a/executor/nop_metriclog_test.go b/executor/nop_metriclog_test.go index df7a9dd6..4aa66525 100644 --- a/executor/nop_metriclog_test.go +++ b/executor/nop_metriclog_test.go @@ -3,35 +3,35 @@ package executor import ( "context" - "github.com/gobench-io/gobench/v2/pb" + api "github.com/gobench-io/gobench/v2/gen/go/pb" "google.golang.org/grpc" ) // nop metric logger, used for testing type nopLog struct{} -func (n *nopLog) Counter(ctx context.Context, req *pb.CounterReq, opts ...grpc.CallOption) (*pb.CounterRes, error) { +func (n *nopLog) Counter(ctx context.Context, req *api.CounterReq, opts ...grpc.CallOption) (*api.CounterRes, error) { return nil, nil } -func (n *nopLog) Histogram(ctx context.Context, req *pb.HistogramReq, opts ...grpc.CallOption) (*pb.HistogramRes, error) { +func (n *nopLog) Histogram(ctx context.Context, req *api.HistogramReq, opts ...grpc.CallOption) (*api.HistogramRes, error) { return nil, nil } -func (n *nopLog) Gauge(ctx context.Context, req *pb.GaugeReq, opts ...grpc.CallOption) (*pb.GaugeRes, error) { +func (n *nopLog) Gauge(ctx context.Context, req *api.GaugeReq, opts ...grpc.CallOption) (*api.GaugeRes, error) { return nil, nil } -func (n *nopLog) FindCreateGroup(ctx context.Context, req *pb.FCGroupReq, opts ...grpc.CallOption) (*pb.FCGroupRes, error) { - return new(pb.FCGroupRes), nil +func (n *nopLog) FindCreateGroup(ctx context.Context, req *api.FCGroupReq, opts ...grpc.CallOption) (*api.FCGroupRes, error) { + return new(api.FCGroupRes), nil } -func (n *nopLog) FindCreateGraph(ctx context.Context, req *pb.FCGraphReq, opts ...grpc.CallOption) (*pb.FCGraphRes, error) { - return new(pb.FCGraphRes), nil +func (n *nopLog) FindCreateGraph(ctx context.Context, req *api.FCGraphReq, opts ...grpc.CallOption) (*api.FCGraphRes, error) { + return new(api.FCGraphRes), nil } -func (n *nopLog) FindCreateMetric(ctx context.Context, req *pb.FCMetricReq, opts ...grpc.CallOption) (*pb.FCMetricRes, error) { - return new(pb.FCMetricRes), nil +func (n *nopLog) FindCreateMetric(ctx context.Context, req *api.FCMetricReq, opts ...grpc.CallOption) (*api.FCMetricRes, error) { + return new(api.FCMetricRes), nil } // NewNopMetricLog returns a no-op metric logger diff --git a/executor/rpc_server.go b/executor/rpc_server.go index 5249d86a..081c068e 100644 --- a/executor/rpc_server.go +++ b/executor/rpc_server.go @@ -4,34 +4,34 @@ import ( "context" "os" - "github.com/gobench-io/gobench/v2/pb" + api "github.com/gobench-io/gobench/v2/gen/go/pb" ) // Start begins to run the program -func (m *Executor) Start(ctx context.Context, req *pb.StartRequest) (*pb.StartResult, error) { - m.logger.Infow("executor rpc starting") +func (e *Executor) Start(ctx context.Context, req *api.StartRequest) (*api.StartResult, error) { + e.logger.Infow("executor rpc starting") - err := m.run(ctx) + err := e.run(ctx) - m.logger.Infow("executor rpc finished") + e.logger.Infow("executor rpc finished") if err != nil { return nil, err } - res := new(pb.StartResult) - res.AppID = int64(m.appID) + res := new(api.StartResult) + res.AppID = int64(e.appID) res.Success = true return res, nil } // Terminate shutdown this executor process -func (m *Executor) Terminate(ctx context.Context, req *pb.TermRequest) (*pb.TermResult, error) { +func (e *Executor) Terminate(ctx context.Context, req *api.TermRequest) (*api.TermResult, error) { os.Exit(int(req.Code)) - res := new(pb.TermResult) - res.AppID = int64(m.appID) + res := new(api.TermResult) + res.AppID = int64(e.appID) res.Success = true return res, nil diff --git a/master/metriclog.go b/master/metriclog.go index edf9e115..1345506d 100644 --- a/master/metriclog.go +++ b/master/metriclog.go @@ -4,15 +4,14 @@ import ( "context" "github.com/gobench-io/gobench/v2/ent" - "github.com/gobench-io/gobench/v2/pb" - entApp "github.com/gobench-io/gobench/v2/ent/application" entGraph "github.com/gobench-io/gobench/v2/ent/graph" entGroup "github.com/gobench-io/gobench/v2/ent/group" entMetric "github.com/gobench-io/gobench/v2/ent/metric" + api "github.com/gobench-io/gobench/v2/gen/go/pb" ) -func (m *Master) Counter(ctx context.Context, req *pb.CounterReq) (*pb.CounterRes, error) { +func (m *Master) Counter(ctx context.Context, req *api.CounterReq) (*api.CounterRes, error) { // todo: check appID condition _, err := m.db.Counter.Create(). SetWID(req.Base.EID). @@ -24,12 +23,12 @@ func (m *Master) Counter(ctx context.Context, req *pb.CounterReq) (*pb.CounterRe return nil, err } - res := new(pb.CounterRes) + res := new(api.CounterRes) return res, nil } -func (m *Master) Histogram(ctx context.Context, req *pb.HistogramReq) (*pb.HistogramRes, error) { +func (m *Master) Histogram(ctx context.Context, req *api.HistogramReq) (*api.HistogramRes, error) { // todo: check appID condition _, err := m.db.Histogram.Create(). SetWID(req.Base.EID). @@ -50,12 +49,12 @@ func (m *Master) Histogram(ctx context.Context, req *pb.HistogramReq) (*pb.Histo return nil, err } - res := new(pb.HistogramRes) + res := new(api.HistogramRes) return res, nil } -func (m *Master) Gauge(ctx context.Context, req *pb.GaugeReq) (*pb.GaugeRes, error) { +func (m *Master) Gauge(ctx context.Context, req *api.GaugeReq) (*api.GaugeRes, error) { // todo: check appID condition _, err := m.db.Gauge.Create(). SetWID(req.Base.EID). @@ -67,16 +66,16 @@ func (m *Master) Gauge(ctx context.Context, req *pb.GaugeReq) (*pb.GaugeRes, err return nil, err } - res := new(pb.GaugeRes) + res := new(api.GaugeRes) return res, nil } // FindCreateGroup find or create new group // return the existing/new group ent, is created, and error -func (m *Master) FindCreateGroup(ctx context.Context, req *pb.FCGroupReq) (res *pb.FCGroupRes, err error) { +func (m *Master) FindCreateGroup(ctx context.Context, req *api.FCGroupReq) (res *api.FCGroupRes, err error) { var eg *ent.Group - res = new(pb.FCGroupRes) + res = new(api.FCGroupRes) defer func() { if err == nil { @@ -112,9 +111,9 @@ func (m *Master) FindCreateGroup(ctx context.Context, req *pb.FCGroupReq) (res * return } -func (m *Master) FindCreateGraph(ctx context.Context, req *pb.FCGraphReq) (res *pb.FCGraphRes, err error) { +func (m *Master) FindCreateGraph(ctx context.Context, req *api.FCGraphReq) (res *api.FCGraphRes, err error) { var egraph *ent.Graph - res = new(pb.FCGraphRes) + res = new(api.FCGraphRes) defer func() { if err == nil { @@ -149,9 +148,9 @@ func (m *Master) FindCreateGraph(ctx context.Context, req *pb.FCGraphReq) (res * return } -func (m *Master) FindCreateMetric(ctx context.Context, req *pb.FCMetricReq) (res *pb.FCMetricRes, err error) { +func (m *Master) FindCreateMetric(ctx context.Context, req *api.FCMetricReq) (res *api.FCMetricRes, err error) { var emetric *ent.Metric - res = new(pb.FCMetricRes) + res = new(api.FCMetricRes) defer func() { if err == nil { diff --git a/master/metriclog_test.go b/master/metriclog_test.go index 6d3cd80a..25da7d70 100644 --- a/master/metriclog_test.go +++ b/master/metriclog_test.go @@ -10,7 +10,7 @@ import ( entGroup "github.com/gobench-io/gobench/v2/ent/group" entMetric "github.com/gobench-io/gobench/v2/ent/metric" "github.com/gobench-io/gobench/v2/executor/metrics" - "github.com/gobench-io/gobench/v2/pb" + api "github.com/gobench-io/gobench/v2/gen/go/pb" "github.com/stretchr/testify/assert" ) @@ -28,7 +28,7 @@ func TestFindCreateGroup(t *testing.T) { groupRes, err := m.FindCreateGroup( ctx, - &pb.FCGroupReq{ + &api.FCGroupReq{ Name: groupName, AppID: int64(m.job.app.ID), }, @@ -50,7 +50,7 @@ func TestFindCreateGroup(t *testing.T) { // call the same RPC, the result should be like before groupRes2, err := m.FindCreateGroup( ctx, - &pb.FCGroupReq{ + &api.FCGroupReq{ Name: groupName, AppID: int64(m.job.app.ID), }, @@ -70,13 +70,13 @@ func TestFindCreateGraph(t *testing.T) { prefix := time.Now().String() groupName := "HTTP (" + prefix + ")" - groupRes, err := m.FindCreateGroup(ctx, &pb.FCGroupReq{ + groupRes, err := m.FindCreateGroup(ctx, &api.FCGroupReq{ Name: groupName, AppID: int64(m.job.app.ID), }) assert.Nil(t, err) - graphReq := &pb.FCGraphReq{ + graphReq := &api.FCGraphReq{ Title: "HTTP Response", Unit: "N", GroupID: int64(groupRes.Id), @@ -115,14 +115,14 @@ func TestFindCreateMetric(t *testing.T) { groupName := "HTTP (" + prefix + ")" // create new group - groupRes, err := m.FindCreateGroup(ctx, &pb.FCGroupReq{ + groupRes, err := m.FindCreateGroup(ctx, &api.FCGroupReq{ AppID: int64(m.job.app.ID), Name: groupName, }) assert.Nil(t, err) // create new graph - graphReq := &pb.FCGraphReq{ + graphReq := &api.FCGraphReq{ AppID: int64(m.job.app.ID), Title: "HTTP Response", Unit: "N", @@ -132,7 +132,7 @@ func TestFindCreateMetric(t *testing.T) { assert.Nil(t, err) // create new metric - metricReq := &pb.FCMetricReq{ + metricReq := &api.FCMetricReq{ AppID: int64(m.job.app.ID), Title: ".http_ok", Type: string(metrics.Counter), diff --git a/pb/agent.pb.go b/pb/agent.pb.go deleted file mode 100644 index 825d42ee..00000000 --- a/pb/agent.pb.go +++ /dev/null @@ -1,1172 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.14.0 -// source: pb/agent.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// find or create group -type FCGroupReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppID int64 `protobuf:"varint,1,opt,name=appID,proto3" json:"appID,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *FCGroupReq) Reset() { - *x = FCGroupReq{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FCGroupReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FCGroupReq) ProtoMessage() {} - -func (x *FCGroupReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FCGroupReq.ProtoReflect.Descriptor instead. -func (*FCGroupReq) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{0} -} - -func (x *FCGroupReq) GetAppID() int64 { - if x != nil { - return x.AppID - } - return 0 -} - -func (x *FCGroupReq) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type FCGroupRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *FCGroupRes) Reset() { - *x = FCGroupRes{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FCGroupRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FCGroupRes) ProtoMessage() {} - -func (x *FCGroupRes) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FCGroupRes.ProtoReflect.Descriptor instead. -func (*FCGroupRes) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{1} -} - -func (x *FCGroupRes) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -// find or create graph -type FCGraphReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppID int64 `protobuf:"varint,1,opt,name=appID,proto3" json:"appID,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit,omitempty"` - GroupID int64 `protobuf:"varint,4,opt,name=groupID,proto3" json:"groupID,omitempty"` -} - -func (x *FCGraphReq) Reset() { - *x = FCGraphReq{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FCGraphReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FCGraphReq) ProtoMessage() {} - -func (x *FCGraphReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FCGraphReq.ProtoReflect.Descriptor instead. -func (*FCGraphReq) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{2} -} - -func (x *FCGraphReq) GetAppID() int64 { - if x != nil { - return x.AppID - } - return 0 -} - -func (x *FCGraphReq) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *FCGraphReq) GetUnit() string { - if x != nil { - return x.Unit - } - return "" -} - -func (x *FCGraphReq) GetGroupID() int64 { - if x != nil { - return x.GroupID - } - return 0 -} - -type FCGraphRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *FCGraphRes) Reset() { - *x = FCGraphRes{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FCGraphRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FCGraphRes) ProtoMessage() {} - -func (x *FCGraphRes) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FCGraphRes.ProtoReflect.Descriptor instead. -func (*FCGraphRes) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{3} -} - -func (x *FCGraphRes) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -// find or create metric -type FCMetricReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppID int64 `protobuf:"varint,1,opt,name=appID,proto3" json:"appID,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - GraphID int64 `protobuf:"varint,4,opt,name=graphID,proto3" json:"graphID,omitempty"` -} - -func (x *FCMetricReq) Reset() { - *x = FCMetricReq{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FCMetricReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FCMetricReq) ProtoMessage() {} - -func (x *FCMetricReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FCMetricReq.ProtoReflect.Descriptor instead. -func (*FCMetricReq) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{4} -} - -func (x *FCMetricReq) GetAppID() int64 { - if x != nil { - return x.AppID - } - return 0 -} - -func (x *FCMetricReq) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *FCMetricReq) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *FCMetricReq) GetGraphID() int64 { - if x != nil { - return x.GraphID - } - return 0 -} - -type FCMetricRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *FCMetricRes) Reset() { - *x = FCMetricRes{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FCMetricRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FCMetricRes) ProtoMessage() {} - -func (x *FCMetricRes) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FCMetricRes.ProtoReflect.Descriptor instead. -func (*FCMetricRes) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{5} -} - -func (x *FCMetricRes) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -// histogram, counter, gauge -type BasedReqMetric struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppID int64 `protobuf:"varint,1,opt,name=appID,proto3" json:"appID,omitempty"` // app ID - EID string `protobuf:"bytes,2,opt,name=eID,proto3" json:"eID,omitempty"` // executor ID - MID int64 `protobuf:"varint,3,opt,name=mID,proto3" json:"mID,omitempty"` // metric ID - Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` -} - -func (x *BasedReqMetric) Reset() { - *x = BasedReqMetric{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BasedReqMetric) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BasedReqMetric) ProtoMessage() {} - -func (x *BasedReqMetric) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BasedReqMetric.ProtoReflect.Descriptor instead. -func (*BasedReqMetric) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{6} -} - -func (x *BasedReqMetric) GetAppID() int64 { - if x != nil { - return x.AppID - } - return 0 -} - -func (x *BasedReqMetric) GetEID() string { - if x != nil { - return x.EID - } - return "" -} - -func (x *BasedReqMetric) GetMID() int64 { - if x != nil { - return x.MID - } - return 0 -} - -func (x *BasedReqMetric) GetTime() int64 { - if x != nil { - return x.Time - } - return 0 -} - -type HistogramValues struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Min int64 `protobuf:"varint,2,opt,name=min,proto3" json:"min,omitempty"` - Max int64 `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"` - Mean float64 `protobuf:"fixed64,4,opt,name=mean,proto3" json:"mean,omitempty"` - Stddev float64 `protobuf:"fixed64,5,opt,name=stddev,proto3" json:"stddev,omitempty"` - Median float64 `protobuf:"fixed64,6,opt,name=median,proto3" json:"median,omitempty"` - P75 float64 `protobuf:"fixed64,7,opt,name=p75,proto3" json:"p75,omitempty"` - P95 float64 `protobuf:"fixed64,8,opt,name=p95,proto3" json:"p95,omitempty"` - P99 float64 `protobuf:"fixed64,9,opt,name=p99,proto3" json:"p99,omitempty"` - P999 float64 `protobuf:"fixed64,10,opt,name=p999,proto3" json:"p999,omitempty"` -} - -func (x *HistogramValues) Reset() { - *x = HistogramValues{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HistogramValues) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HistogramValues) ProtoMessage() {} - -func (x *HistogramValues) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HistogramValues.ProtoReflect.Descriptor instead. -func (*HistogramValues) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{7} -} - -func (x *HistogramValues) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *HistogramValues) GetMin() int64 { - if x != nil { - return x.Min - } - return 0 -} - -func (x *HistogramValues) GetMax() int64 { - if x != nil { - return x.Max - } - return 0 -} - -func (x *HistogramValues) GetMean() float64 { - if x != nil { - return x.Mean - } - return 0 -} - -func (x *HistogramValues) GetStddev() float64 { - if x != nil { - return x.Stddev - } - return 0 -} - -func (x *HistogramValues) GetMedian() float64 { - if x != nil { - return x.Median - } - return 0 -} - -func (x *HistogramValues) GetP75() float64 { - if x != nil { - return x.P75 - } - return 0 -} - -func (x *HistogramValues) GetP95() float64 { - if x != nil { - return x.P95 - } - return 0 -} - -func (x *HistogramValues) GetP99() float64 { - if x != nil { - return x.P99 - } - return 0 -} - -func (x *HistogramValues) GetP999() float64 { - if x != nil { - return x.P999 - } - return 0 -} - -type HistogramReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Base *BasedReqMetric `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` - Histogram *HistogramValues `protobuf:"bytes,2,opt,name=histogram,proto3" json:"histogram,omitempty"` -} - -func (x *HistogramReq) Reset() { - *x = HistogramReq{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HistogramReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HistogramReq) ProtoMessage() {} - -func (x *HistogramReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HistogramReq.ProtoReflect.Descriptor instead. -func (*HistogramReq) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{8} -} - -func (x *HistogramReq) GetBase() *BasedReqMetric { - if x != nil { - return x.Base - } - return nil -} - -func (x *HistogramReq) GetHistogram() *HistogramValues { - if x != nil { - return x.Histogram - } - return nil -} - -type HistogramRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *HistogramRes) Reset() { - *x = HistogramRes{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HistogramRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HistogramRes) ProtoMessage() {} - -func (x *HistogramRes) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HistogramRes.ProtoReflect.Descriptor instead. -func (*HistogramRes) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{9} -} - -type CounterReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Base *BasedReqMetric `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` - Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *CounterReq) Reset() { - *x = CounterReq{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CounterReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CounterReq) ProtoMessage() {} - -func (x *CounterReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CounterReq.ProtoReflect.Descriptor instead. -func (*CounterReq) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{10} -} - -func (x *CounterReq) GetBase() *BasedReqMetric { - if x != nil { - return x.Base - } - return nil -} - -func (x *CounterReq) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -type CounterRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CounterRes) Reset() { - *x = CounterRes{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CounterRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CounterRes) ProtoMessage() {} - -func (x *CounterRes) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CounterRes.ProtoReflect.Descriptor instead. -func (*CounterRes) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{11} -} - -type GaugeReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Base *BasedReqMetric `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` - Gauge int64 `protobuf:"varint,2,opt,name=gauge,proto3" json:"gauge,omitempty"` -} - -func (x *GaugeReq) Reset() { - *x = GaugeReq{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GaugeReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GaugeReq) ProtoMessage() {} - -func (x *GaugeReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GaugeReq.ProtoReflect.Descriptor instead. -func (*GaugeReq) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{12} -} - -func (x *GaugeReq) GetBase() *BasedReqMetric { - if x != nil { - return x.Base - } - return nil -} - -func (x *GaugeReq) GetGauge() int64 { - if x != nil { - return x.Gauge - } - return 0 -} - -type GaugeRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GaugeRes) Reset() { - *x = GaugeRes{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_agent_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GaugeRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GaugeRes) ProtoMessage() {} - -func (x *GaugeRes) ProtoReflect() protoreflect.Message { - mi := &file_pb_agent_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GaugeRes.ProtoReflect.Descriptor instead. -func (*GaugeRes) Descriptor() ([]byte, []int) { - return file_pb_agent_proto_rawDescGZIP(), []int{13} -} - -var File_pb_agent_proto protoreflect.FileDescriptor - -var file_pb_agent_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x70, 0x62, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x02, 0x70, 0x62, 0x22, 0x36, 0x0a, 0x0a, 0x46, 0x43, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, - 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x1c, 0x0a, 0x0a, - 0x46, 0x43, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x66, 0x0a, 0x0a, 0x46, 0x43, - 0x47, 0x72, 0x61, 0x70, 0x68, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, - 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x49, 0x44, 0x22, 0x1c, 0x0a, 0x0a, 0x46, 0x43, 0x47, 0x72, 0x61, 0x70, 0x68, 0x52, 0x65, 0x73, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x67, 0x0a, 0x0b, 0x46, 0x43, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x65, 0x71, 0x12, - 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, - 0x61, 0x70, 0x70, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x70, 0x68, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x07, 0x67, 0x72, 0x61, 0x70, 0x68, 0x49, 0x44, 0x22, 0x1d, 0x0a, 0x0b, 0x46, 0x43, 0x4d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5e, 0x0a, 0x0e, 0x42, 0x61, 0x73, 0x65, - 0x64, 0x52, 0x65, 0x71, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, - 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, - 0x12, 0x10, 0x0a, 0x03, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, - 0x49, 0x44, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x03, 0x6d, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xd9, 0x01, 0x0a, 0x0f, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x61, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x6d, 0x65, 0x61, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, - 0x64, 0x64, 0x65, 0x76, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x73, 0x74, 0x64, 0x64, - 0x65, 0x76, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x06, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x37, - 0x35, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x70, 0x37, 0x35, 0x12, 0x10, 0x0a, 0x03, - 0x70, 0x39, 0x35, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x70, 0x39, 0x35, 0x12, 0x10, - 0x0a, 0x03, 0x70, 0x39, 0x39, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x70, 0x39, 0x39, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x39, 0x39, 0x39, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, - 0x70, 0x39, 0x39, 0x39, 0x22, 0x69, 0x0a, 0x0c, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, - 0x6d, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x64, 0x52, 0x65, 0x71, - 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x09, - 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x52, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x22, - 0x0e, 0x0a, 0x0c, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x22, - 0x4a, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, - 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, - 0x2e, 0x42, 0x61, 0x73, 0x65, 0x64, 0x52, 0x65, 0x71, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, - 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x0c, 0x0a, 0x0a, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x22, 0x48, 0x0a, 0x08, 0x47, 0x61, 0x75, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x64, 0x52, 0x65, - 0x71, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x67, 0x61, - 0x75, 0x67, 0x65, 0x22, 0x0a, 0x0a, 0x08, 0x47, 0x61, 0x75, 0x67, 0x65, 0x52, 0x65, 0x73, 0x32, - 0xa4, 0x02, 0x0a, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x0f, 0x46, 0x69, 0x6e, - 0x64, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x2e, 0x70, - 0x62, 0x2e, 0x46, 0x43, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x70, - 0x62, 0x2e, 0x46, 0x43, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x0f, - 0x46, 0x69, 0x6e, 0x64, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x61, 0x70, 0x68, 0x12, - 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x43, 0x47, 0x72, 0x61, 0x70, 0x68, 0x52, 0x65, 0x71, 0x1a, - 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x43, 0x47, 0x72, 0x61, 0x70, 0x68, 0x52, 0x65, 0x73, 0x12, - 0x34, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x43, 0x4d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x43, 0x4d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x52, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x09, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, - 0x61, 0x6d, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, - 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, - 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, - 0x72, 0x12, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x12, 0x23, 0x0a, 0x05, 0x47, 0x61, 0x75, 0x67, 0x65, 0x12, 0x0c, 0x2e, 0x70, 0x62, 0x2e, - 0x47, 0x61, 0x75, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x61, - 0x75, 0x67, 0x65, 0x52, 0x65, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_pb_agent_proto_rawDescOnce sync.Once - file_pb_agent_proto_rawDescData = file_pb_agent_proto_rawDesc -) - -func file_pb_agent_proto_rawDescGZIP() []byte { - file_pb_agent_proto_rawDescOnce.Do(func() { - file_pb_agent_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_agent_proto_rawDescData) - }) - return file_pb_agent_proto_rawDescData -} - -var file_pb_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_pb_agent_proto_goTypes = []interface{}{ - (*FCGroupReq)(nil), // 0: pb.FCGroupReq - (*FCGroupRes)(nil), // 1: pb.FCGroupRes - (*FCGraphReq)(nil), // 2: pb.FCGraphReq - (*FCGraphRes)(nil), // 3: pb.FCGraphRes - (*FCMetricReq)(nil), // 4: pb.FCMetricReq - (*FCMetricRes)(nil), // 5: pb.FCMetricRes - (*BasedReqMetric)(nil), // 6: pb.BasedReqMetric - (*HistogramValues)(nil), // 7: pb.HistogramValues - (*HistogramReq)(nil), // 8: pb.HistogramReq - (*HistogramRes)(nil), // 9: pb.HistogramRes - (*CounterReq)(nil), // 10: pb.CounterReq - (*CounterRes)(nil), // 11: pb.CounterRes - (*GaugeReq)(nil), // 12: pb.GaugeReq - (*GaugeRes)(nil), // 13: pb.GaugeRes -} -var file_pb_agent_proto_depIdxs = []int32{ - 6, // 0: pb.HistogramReq.base:type_name -> pb.BasedReqMetric - 7, // 1: pb.HistogramReq.histogram:type_name -> pb.HistogramValues - 6, // 2: pb.CounterReq.base:type_name -> pb.BasedReqMetric - 6, // 3: pb.GaugeReq.base:type_name -> pb.BasedReqMetric - 0, // 4: pb.Agent.FindCreateGroup:input_type -> pb.FCGroupReq - 2, // 5: pb.Agent.FindCreateGraph:input_type -> pb.FCGraphReq - 4, // 6: pb.Agent.FindCreateMetric:input_type -> pb.FCMetricReq - 8, // 7: pb.Agent.Histogram:input_type -> pb.HistogramReq - 10, // 8: pb.Agent.Counter:input_type -> pb.CounterReq - 12, // 9: pb.Agent.Gauge:input_type -> pb.GaugeReq - 1, // 10: pb.Agent.FindCreateGroup:output_type -> pb.FCGroupRes - 3, // 11: pb.Agent.FindCreateGraph:output_type -> pb.FCGraphRes - 5, // 12: pb.Agent.FindCreateMetric:output_type -> pb.FCMetricRes - 9, // 13: pb.Agent.Histogram:output_type -> pb.HistogramRes - 11, // 14: pb.Agent.Counter:output_type -> pb.CounterRes - 13, // 15: pb.Agent.Gauge:output_type -> pb.GaugeRes - 10, // [10:16] is the sub-list for method output_type - 4, // [4:10] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_pb_agent_proto_init() } -func file_pb_agent_proto_init() { - if File_pb_agent_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_pb_agent_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FCGroupReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FCGroupRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FCGraphReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FCGraphRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FCMetricReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FCMetricRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BasedReqMetric); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistogramValues); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistogramReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistogramRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CounterReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CounterRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GaugeReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_agent_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GaugeRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_pb_agent_proto_rawDesc, - NumEnums: 0, - NumMessages: 14, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_pb_agent_proto_goTypes, - DependencyIndexes: file_pb_agent_proto_depIdxs, - MessageInfos: file_pb_agent_proto_msgTypes, - }.Build() - File_pb_agent_proto = out.File - file_pb_agent_proto_rawDesc = nil - file_pb_agent_proto_goTypes = nil - file_pb_agent_proto_depIdxs = nil -} diff --git a/pb/agent_grpc.pb.go b/pb/agent_grpc.pb.go deleted file mode 100644 index 5a535817..00000000 --- a/pb/agent_grpc.pb.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. - -package pb - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// AgentClient is the client API for Agent service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type AgentClient interface { - FindCreateGroup(ctx context.Context, in *FCGroupReq, opts ...grpc.CallOption) (*FCGroupRes, error) - FindCreateGraph(ctx context.Context, in *FCGraphReq, opts ...grpc.CallOption) (*FCGraphRes, error) - FindCreateMetric(ctx context.Context, in *FCMetricReq, opts ...grpc.CallOption) (*FCMetricRes, error) - Histogram(ctx context.Context, in *HistogramReq, opts ...grpc.CallOption) (*HistogramRes, error) - Counter(ctx context.Context, in *CounterReq, opts ...grpc.CallOption) (*CounterRes, error) - Gauge(ctx context.Context, in *GaugeReq, opts ...grpc.CallOption) (*GaugeRes, error) -} - -type agentClient struct { - cc grpc.ClientConnInterface -} - -func NewAgentClient(cc grpc.ClientConnInterface) AgentClient { - return &agentClient{cc} -} - -func (c *agentClient) FindCreateGroup(ctx context.Context, in *FCGroupReq, opts ...grpc.CallOption) (*FCGroupRes, error) { - out := new(FCGroupRes) - err := c.cc.Invoke(ctx, "/pb.Agent/FindCreateGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentClient) FindCreateGraph(ctx context.Context, in *FCGraphReq, opts ...grpc.CallOption) (*FCGraphRes, error) { - out := new(FCGraphRes) - err := c.cc.Invoke(ctx, "/pb.Agent/FindCreateGraph", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentClient) FindCreateMetric(ctx context.Context, in *FCMetricReq, opts ...grpc.CallOption) (*FCMetricRes, error) { - out := new(FCMetricRes) - err := c.cc.Invoke(ctx, "/pb.Agent/FindCreateMetric", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentClient) Histogram(ctx context.Context, in *HistogramReq, opts ...grpc.CallOption) (*HistogramRes, error) { - out := new(HistogramRes) - err := c.cc.Invoke(ctx, "/pb.Agent/Histogram", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentClient) Counter(ctx context.Context, in *CounterReq, opts ...grpc.CallOption) (*CounterRes, error) { - out := new(CounterRes) - err := c.cc.Invoke(ctx, "/pb.Agent/Counter", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentClient) Gauge(ctx context.Context, in *GaugeReq, opts ...grpc.CallOption) (*GaugeRes, error) { - out := new(GaugeRes) - err := c.cc.Invoke(ctx, "/pb.Agent/Gauge", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AgentServer is the server API for Agent service. -// All implementations should embed UnimplementedAgentServer -// for forward compatibility -type AgentServer interface { - FindCreateGroup(context.Context, *FCGroupReq) (*FCGroupRes, error) - FindCreateGraph(context.Context, *FCGraphReq) (*FCGraphRes, error) - FindCreateMetric(context.Context, *FCMetricReq) (*FCMetricRes, error) - Histogram(context.Context, *HistogramReq) (*HistogramRes, error) - Counter(context.Context, *CounterReq) (*CounterRes, error) - Gauge(context.Context, *GaugeReq) (*GaugeRes, error) -} - -// UnimplementedAgentServer should be embedded to have forward compatible implementations. -type UnimplementedAgentServer struct { -} - -func (UnimplementedAgentServer) FindCreateGroup(context.Context, *FCGroupReq) (*FCGroupRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindCreateGroup not implemented") -} -func (UnimplementedAgentServer) FindCreateGraph(context.Context, *FCGraphReq) (*FCGraphRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindCreateGraph not implemented") -} -func (UnimplementedAgentServer) FindCreateMetric(context.Context, *FCMetricReq) (*FCMetricRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindCreateMetric not implemented") -} -func (UnimplementedAgentServer) Histogram(context.Context, *HistogramReq) (*HistogramRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method Histogram not implemented") -} -func (UnimplementedAgentServer) Counter(context.Context, *CounterReq) (*CounterRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method Counter not implemented") -} -func (UnimplementedAgentServer) Gauge(context.Context, *GaugeReq) (*GaugeRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method Gauge not implemented") -} - -// UnsafeAgentServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AgentServer will -// result in compilation errors. -type UnsafeAgentServer interface { - mustEmbedUnimplementedAgentServer() -} - -func RegisterAgentServer(s grpc.ServiceRegistrar, srv AgentServer) { - s.RegisterService(&Agent_ServiceDesc, srv) -} - -func _Agent_FindCreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FCGroupReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).FindCreateGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Agent/FindCreateGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).FindCreateGroup(ctx, req.(*FCGroupReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Agent_FindCreateGraph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FCGraphReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).FindCreateGraph(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Agent/FindCreateGraph", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).FindCreateGraph(ctx, req.(*FCGraphReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Agent_FindCreateMetric_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FCMetricReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).FindCreateMetric(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Agent/FindCreateMetric", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).FindCreateMetric(ctx, req.(*FCMetricReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Agent_Histogram_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HistogramReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).Histogram(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Agent/Histogram", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).Histogram(ctx, req.(*HistogramReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Agent_Counter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CounterReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).Counter(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Agent/Counter", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).Counter(ctx, req.(*CounterReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Agent_Gauge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GaugeReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).Gauge(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Agent/Gauge", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).Gauge(ctx, req.(*GaugeReq)) - } - return interceptor(ctx, in, info, handler) -} - -// Agent_ServiceDesc is the grpc.ServiceDesc for Agent service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Agent_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "pb.Agent", - HandlerType: (*AgentServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "FindCreateGroup", - Handler: _Agent_FindCreateGroup_Handler, - }, - { - MethodName: "FindCreateGraph", - Handler: _Agent_FindCreateGraph_Handler, - }, - { - MethodName: "FindCreateMetric", - Handler: _Agent_FindCreateMetric_Handler, - }, - { - MethodName: "Histogram", - Handler: _Agent_Histogram_Handler, - }, - { - MethodName: "Counter", - Handler: _Agent_Counter_Handler, - }, - { - MethodName: "Gauge", - Handler: _Agent_Gauge_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "pb/agent.proto", -} diff --git a/pb/executor.pb.go b/pb/executor.pb.go deleted file mode 100644 index f5dcc351..00000000 --- a/pb/executor.pb.go +++ /dev/null @@ -1,372 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.14.0 -// source: pb/executor.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type StartRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppID int64 `protobuf:"varint,1,opt,name=appID,proto3" json:"appID,omitempty"` -} - -func (x *StartRequest) Reset() { - *x = StartRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_executor_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartRequest) ProtoMessage() {} - -func (x *StartRequest) ProtoReflect() protoreflect.Message { - mi := &file_pb_executor_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartRequest.ProtoReflect.Descriptor instead. -func (*StartRequest) Descriptor() ([]byte, []int) { - return file_pb_executor_proto_rawDescGZIP(), []int{0} -} - -func (x *StartRequest) GetAppID() int64 { - if x != nil { - return x.AppID - } - return 0 -} - -type StartResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppID int64 `protobuf:"varint,1,opt,name=appID,proto3" json:"appID,omitempty"` - Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"` -} - -func (x *StartResult) Reset() { - *x = StartResult{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_executor_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartResult) ProtoMessage() {} - -func (x *StartResult) ProtoReflect() protoreflect.Message { - mi := &file_pb_executor_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartResult.ProtoReflect.Descriptor instead. -func (*StartResult) Descriptor() ([]byte, []int) { - return file_pb_executor_proto_rawDescGZIP(), []int{1} -} - -func (x *StartResult) GetAppID() int64 { - if x != nil { - return x.AppID - } - return 0 -} - -func (x *StartResult) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -type TermRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppID int64 `protobuf:"varint,1,opt,name=appID,proto3" json:"appID,omitempty"` - Code int64 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` -} - -func (x *TermRequest) Reset() { - *x = TermRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_executor_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TermRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TermRequest) ProtoMessage() {} - -func (x *TermRequest) ProtoReflect() protoreflect.Message { - mi := &file_pb_executor_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TermRequest.ProtoReflect.Descriptor instead. -func (*TermRequest) Descriptor() ([]byte, []int) { - return file_pb_executor_proto_rawDescGZIP(), []int{2} -} - -func (x *TermRequest) GetAppID() int64 { - if x != nil { - return x.AppID - } - return 0 -} - -func (x *TermRequest) GetCode() int64 { - if x != nil { - return x.Code - } - return 0 -} - -type TermResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppID int64 `protobuf:"varint,1,opt,name=appID,proto3" json:"appID,omitempty"` - Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"` -} - -func (x *TermResult) Reset() { - *x = TermResult{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_executor_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TermResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TermResult) ProtoMessage() {} - -func (x *TermResult) ProtoReflect() protoreflect.Message { - mi := &file_pb_executor_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TermResult.ProtoReflect.Descriptor instead. -func (*TermResult) Descriptor() ([]byte, []int) { - return file_pb_executor_proto_rawDescGZIP(), []int{3} -} - -func (x *TermResult) GetAppID() int64 { - if x != nil { - return x.AppID - } - return 0 -} - -func (x *TermResult) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -var File_pb_executor_proto protoreflect.FileDescriptor - -var file_pb_executor_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x70, 0x62, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x24, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x3d, 0x0a, - 0x0b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x61, 0x70, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, - 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x37, 0x0a, 0x0b, - 0x54, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, - 0x70, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, - 0x44, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3c, 0x0a, 0x0a, 0x54, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x32, 0x64, 0x0a, 0x08, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x12, - 0x2a, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2c, 0x0a, 0x09, 0x54, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x65, - 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x54, - 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_pb_executor_proto_rawDescOnce sync.Once - file_pb_executor_proto_rawDescData = file_pb_executor_proto_rawDesc -) - -func file_pb_executor_proto_rawDescGZIP() []byte { - file_pb_executor_proto_rawDescOnce.Do(func() { - file_pb_executor_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_executor_proto_rawDescData) - }) - return file_pb_executor_proto_rawDescData -} - -var file_pb_executor_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_pb_executor_proto_goTypes = []interface{}{ - (*StartRequest)(nil), // 0: pb.StartRequest - (*StartResult)(nil), // 1: pb.StartResult - (*TermRequest)(nil), // 2: pb.TermRequest - (*TermResult)(nil), // 3: pb.TermResult -} -var file_pb_executor_proto_depIdxs = []int32{ - 0, // 0: pb.Executor.Start:input_type -> pb.StartRequest - 2, // 1: pb.Executor.Terminate:input_type -> pb.TermRequest - 1, // 2: pb.Executor.Start:output_type -> pb.StartResult - 3, // 3: pb.Executor.Terminate:output_type -> pb.TermResult - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_pb_executor_proto_init() } -func file_pb_executor_proto_init() { - if File_pb_executor_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_pb_executor_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_executor_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_executor_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TermRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pb_executor_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TermResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_pb_executor_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_pb_executor_proto_goTypes, - DependencyIndexes: file_pb_executor_proto_depIdxs, - MessageInfos: file_pb_executor_proto_msgTypes, - }.Build() - File_pb_executor_proto = out.File - file_pb_executor_proto_rawDesc = nil - file_pb_executor_proto_goTypes = nil - file_pb_executor_proto_depIdxs = nil -} diff --git a/pb/executor_grpc.pb.go b/pb/executor_grpc.pb.go deleted file mode 100644 index d418363b..00000000 --- a/pb/executor_grpc.pb.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. - -package pb - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// ExecutorClient is the client API for Executor service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ExecutorClient interface { - Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResult, error) - Terminate(ctx context.Context, in *TermRequest, opts ...grpc.CallOption) (*TermResult, error) -} - -type executorClient struct { - cc grpc.ClientConnInterface -} - -func NewExecutorClient(cc grpc.ClientConnInterface) ExecutorClient { - return &executorClient{cc} -} - -func (c *executorClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResult, error) { - out := new(StartResult) - err := c.cc.Invoke(ctx, "/pb.Executor/Start", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *executorClient) Terminate(ctx context.Context, in *TermRequest, opts ...grpc.CallOption) (*TermResult, error) { - out := new(TermResult) - err := c.cc.Invoke(ctx, "/pb.Executor/Terminate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ExecutorServer is the server API for Executor service. -// All implementations should embed UnimplementedExecutorServer -// for forward compatibility -type ExecutorServer interface { - Start(context.Context, *StartRequest) (*StartResult, error) - Terminate(context.Context, *TermRequest) (*TermResult, error) -} - -// UnimplementedExecutorServer should be embedded to have forward compatible implementations. -type UnimplementedExecutorServer struct { -} - -func (UnimplementedExecutorServer) Start(context.Context, *StartRequest) (*StartResult, error) { - return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") -} -func (UnimplementedExecutorServer) Terminate(context.Context, *TermRequest) (*TermResult, error) { - return nil, status.Errorf(codes.Unimplemented, "method Terminate not implemented") -} - -// UnsafeExecutorServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ExecutorServer will -// result in compilation errors. -type UnsafeExecutorServer interface { - mustEmbedUnimplementedExecutorServer() -} - -func RegisterExecutorServer(s grpc.ServiceRegistrar, srv ExecutorServer) { - s.RegisterService(&Executor_ServiceDesc, srv) -} - -func _Executor_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ExecutorServer).Start(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Executor/Start", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExecutorServer).Start(ctx, req.(*StartRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Executor_Terminate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TermRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ExecutorServer).Terminate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Executor/Terminate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExecutorServer).Terminate(ctx, req.(*TermRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Executor_ServiceDesc is the grpc.ServiceDesc for Executor service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Executor_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "pb.Executor", - HandlerType: (*ExecutorServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Start", - Handler: _Executor_Start_Handler, - }, - { - MethodName: "Terminate", - Handler: _Executor_Terminate_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "pb/executor.proto", -}