From 2a7b4ea4743006f9f8dca3702b9d2f12351685a9 Mon Sep 17 00:00:00 2001 From: tornado-ssy <1658166944@qq.com> Date: Wed, 26 Jul 2023 19:17:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dkie=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E9=85=8D=E7=BD=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/service/kv/kv_svc.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/service/kv/kv_svc.go b/server/service/kv/kv_svc.go index b5bc2cb2..acac1da5 100644 --- a/server/service/kv/kv_svc.go +++ b/server/service/kv/kv_svc.go @@ -134,7 +134,7 @@ func Create(ctx context.Context, kv *model.KVDoc) (*model.KVDoc, *errsvc.Error) fmt.Sprintf("can not updateKeyValue version for [%s] [%s] in [%s]", kv.Key, kv.Labels, kv.Domain)) } - openlog.Debug(fmt.Sprintf("create %s with labels %s value [%s]", kv.Key, kv.Labels, kv.Value)) + openlog.Debug(fmt.Sprintf("create %s with labels %s length [%d]", kv.Key, kv.Labels, len(kv.Value))) datasource.ClearPart(kv) return kv, nil } @@ -246,8 +246,8 @@ func Update(ctx context.Context, kv *model.UpdateKVRequest) (*model.KVDoc, error return nil, err } openlog.Info( - fmt.Sprintf("update %s with labels %s value [%s]", - oldKV.Key, oldKV.Labels, kv.Value)) + fmt.Sprintf("update %s with labels %s length [%d]", + oldKV.Key, oldKV.Labels, len(kv.Value))) err = datasource.GetBroker().GetHistoryDao().AddHistory(ctx, oldKV) if err != nil { openlog.Error( @@ -255,8 +255,8 @@ func Update(ctx context.Context, kv *model.UpdateKVRequest) (*model.KVDoc, error oldKV.Key, oldKV.Labels, kv.Domain, err)) } openlog.Debug( - fmt.Sprintf("add history %s with labels %s value [%s]", - oldKV.Key, oldKV.Labels, oldKV.Value)) + fmt.Sprintf("add history %s with labels %s length [%d]", + oldKV.Key, oldKV.Labels, len(oldKV.Value))) datasource.ClearPart(oldKV) return oldKV, nil From d4b5fca80b50bf897ae1f2a8230c784ab5632f2b Mon Sep 17 00:00:00 2001 From: tornado-ssy <1658166944@qq.com> Date: Thu, 27 Jul 2023 20:18:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E8=A2=AB=E9=99=90=E6=B5=81=E4=BD=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/dev/conf/chassis.yaml | 9 +++++++-- scripts/start.sh | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/examples/dev/conf/chassis.yaml b/examples/dev/conf/chassis.yaml index c9359321..4eab0d22 100755 --- a/examples/dev/conf/chassis.yaml +++ b/examples/dev/conf/chassis.yaml @@ -6,9 +6,14 @@ servicecomb: protocols: rest: listenAddress: 127.0.0.1:30110 + match: + rateLimitPolicy: | + matches: + - apiPath: + contains: "/kie" rateLimiting: - global: | - match: none + limiterPolicy1: | + match: rateLimitPolicy rate: 200 burst: 200 handler: diff --git a/scripts/start.sh b/scripts/start.sh index 2882f4ea..8e0b662f 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -32,9 +32,14 @@ servicecomb: protocols: rest: listenAddress: ${listen_addr}:30110 + match: + rateLimitPolicy: | + matches: + - apiPath: + contains: "/kie" rateLimiting: - global: | - match: none + limiterPolicy1: | + match: rateLimitPolicy rate: 200 burst: 200 handler: