You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ti...@apache.org on 2021/04/19 06:12:26 UTC
[servicecomb-service-center] branch master updated: SCB-2176 Fix:
Statistics should not contain global services (#950)
This is an automated email from the ASF dual-hosted git repository.
tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git
The following commit(s) were added to refs/heads/master by this push:
new 937c82f SCB-2176 Fix: Statistics should not contain global services (#950)
937c82f is described below
commit 937c82f2ffa1747805edb7d746f85b65002a0221
Author: little-cui <su...@qq.com>
AuthorDate: Mon Apr 19 14:12:16 2021 +0800
SCB-2176 Fix: Statistics should not contain global services (#950)
---
datasource/etcd/ms.go | 7 +++----
datasource/mongo/ms.go | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/datasource/etcd/ms.go b/datasource/etcd/ms.go
index 0300495..9339c20 100644
--- a/datasource/etcd/ms.go
+++ b/datasource/etcd/ms.go
@@ -350,19 +350,18 @@ func (ds *DataSource) GetServicesStatistics(ctx context.Context, request *pb.Get
ctx = util.WithCacheOnly(ctx)
var st *pb.Statistics
var err error
- st, err = statistics(ctx, true)
+ st, err = statistics(ctx, false)
if err != nil {
return &pb.GetServicesInfoStatisticsResponse{
Response: pb.CreateResponse(pb.ErrInternal, err.Error()),
}, err
}
return &pb.GetServicesInfoStatisticsResponse{
- Response: pb.CreateResponse(pb.ResponseSuccess, "Get services statistics successfully."),
- Statistics: st,
+ Response: pb.CreateResponse(pb.ResponseSuccess, "Get services statistics successfully."),
+ Statistics: st,
}, nil
}
-
func (ds *DataSource) GetApplications(ctx context.Context, request *pb.GetAppsRequest) (*pb.GetAppsResponse, error) {
domainProject := util.ParseDomainProject(ctx)
key := path.GetServiceAppKey(domainProject, request.Environment, "")
diff --git a/datasource/mongo/ms.go b/datasource/mongo/ms.go
index 4d6c508..bf7773d 100644
--- a/datasource/mongo/ms.go
+++ b/datasource/mongo/ms.go
@@ -539,7 +539,7 @@ func (ds *DataSource) GetServicesStatistics(ctx context.Context, request *discov
ctx = util.WithCacheOnly(ctx)
var st *discovery.Statistics
var err error
- st, err = statistics(ctx, true)
+ st, err = statistics(ctx, false)
if err != nil {
return &discovery.GetServicesInfoStatisticsResponse{
Response: discovery.CreateResponse(discovery.ErrInternal, err.Error()),