Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge from develop #224

Merged
merged 38 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
98c7971
Merge pull request #117 from bytedance/main
zhangyunhao116 Jan 18, 2022
1372042
chore(ci): fix feishu notification (#118)
SilverRainZ Jan 18, 2022
0b4f238
perf(fastrand): optimize Read (#123)
zhangyunhao116 Mar 23, 2022
c38fb59
fix typos (#126)
doaspx Apr 1, 2022
65bf48f
optimize: use bits.Len64 instead of bsr (#129)
Hchenn Apr 13, 2022
87ba34a
feat: support change min/max gc percent limit (#131)
joway Apr 24, 2022
79e6caf
feat(gopool): gopool prints log only when panicHandler is nil (#133)
crimson-gao Apr 26, 2022
d1878f6
fix(xxhash3): support arm64 (#135)
zhangyunhao116 May 9, 2022
b9c1c36
feat(gopool): Pool support WorkerCount() (#137)
lvsz1 May 19, 2022
665b4f2
fix(lscq): move data escape to heap (#140)
zhangyunhao116 May 31, 2022
9d6d3df
fix(metainfo): fix value override by append (#142)
lsjbd Jun 23, 2022
984d38a
fix some typos (#148)
cuishuang Jul 28, 2022
4820298
fix: fix xxhash3 data race (#149)
HuangHongkai Aug 1, 2022
b879a72
fix logger vararg bug (#139)
Andello Aug 17, 2022
beb9000
feat: add RangePersistentValues (#151)
caimufu Aug 24, 2022
48a13c0
fix(skipmap): add missing return in Store (#158)
zhangyunhao116 Oct 9, 2022
a5420d7
feat(lscq): add arm64 support (#152)
kabu1204 Oct 11, 2022
65bdb4b
chore: fix gctuner tests (#157)
joway Oct 25, 2022
1c5718b
feat: generate the level lazily in LoadOrStore (#159)
zhangyunhao116 Oct 28, 2022
68358b8
docs: fix typo of README-CN.md (#161)
Nov 22, 2022
0b68768
feature(metainfo): filter out invalid key-value pairs when converted …
lsjbd Feb 24, 2023
5f61dd1
chore: revert unnecessary dependency change in last commit (#173)
lsjbd Mar 20, 2023
a00d805
feat(metainfo): add WithValues and WithPersistentValues for batch wit…
wzekin Mar 24, 2023
343ae5f
fix(zset): fix wrong func name (#168)
SilverRainZ Apr 18, 2023
7f5f1de
optimise(gopool): no cap by default (#178)
joway May 12, 2023
a129727
chore: downward compatibility for go1.15 (#180)
joway May 31, 2023
614d0af
fix(metainfo): old kvs missed after `WithValues()` (#186)
AsterDY Jul 28, 2023
6e071b2
chore: add owner for channel lib (#197)
joway Dec 19, 2023
a5eedbe
feat: safe and self-adaptive channel (#196)
joway Dec 19, 2023
5e26950
feat: add GetBackwardValueToSend api to get a single backward value t…
jayantxie Feb 2, 2024
21fc7a1
feat: support fastrand in Go 1.22 (#206)
NX-Official Mar 15, 2024
fefc805
perf: metainfo reduce mallocgc (#199)
joway Apr 19, 2024
197ded9
feat: optimize make bytes to reduce memclr cost (#209)
jayantxie May 7, 2024
01b2cbc
fix: channel consume left data after close (#211)
joway May 14, 2024
5df24c0
feat: add span cache (#213)
joway May 31, 2024
a03554c
feat: add GetValueToMap that sets value to the input map (#212)
ppzqh Jul 11, 2024
4d9cac1
chore: fix all unit test ci (#222)
joway Aug 2, 2024
4f14cd9
chore: rm useless and unstable tests codes (#223)
joway Aug 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# global code owners
* @PureWhiteWu @zhangyunhao116
* @PureWhiteWu @zhangyunhao116 @joway

# cache code owners
/cache/asynccache @PureWhiteWu @zhangyunhao116
Expand All @@ -19,6 +19,7 @@
/lang/mcache @PureWhiteWu @zhangyunhao116
/lang/syncx @PureWhiteWu @zhangyunhao116
/lang/stringx @kaka19ace
/lang/channel @joway

# util code owners
/util/gopool @PureWhiteWu @zhangyunhao116
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.15

- uses: actions/cache@v2
with:
Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/feishu-notify.yml

This file was deleted.

147 changes: 0 additions & 147 deletions .github/workflows/pr-benchdiff.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/pr-check.yml

This file was deleted.

13 changes: 8 additions & 5 deletions .github/workflows/push-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.17
go-version: 1.15

- uses: actions/cache@v2
with:
Expand All @@ -24,7 +27,7 @@ jobs:
${{ runner.os }}-go-

- name: Check License Header
uses: apache/skywalking-eyes@main
uses: apache/skywalking-eyes/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -34,4 +37,4 @@ jobs:
go vet -stdmethods=false $(go list ./...)

- name: Unit Test
run: go test -v -cpu=4 -race -covermode=atomic -coverprofile=coverage.out ./...
run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./...
22 changes: 5 additions & 17 deletions cloud/circuitbreaker/breaker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package circuitbreaker
import (
"math/rand"
"sync"
"sync/atomic"
"testing"
"time"
)
Expand Down Expand Up @@ -266,8 +265,8 @@ func TestBreakerReset(t *testing.T) {
}

func TestBreakerConcurrent(t *testing.T) {
cooling := time.Millisecond * 100
retry := time.Millisecond * 50
cooling := time.Millisecond * 1000
retry := time.Millisecond * 500
opt := Options{
CoolingTimeout: cooling,
DetectTimeout: retry,
Expand All @@ -290,26 +289,15 @@ func TestBreakerConcurrent(t *testing.T) {
// CoolingTimeout
time.Sleep(cooling)
var wg sync.WaitGroup
pass := int32(0)
fail := int32(0)
for i := 0; i < 50; i++ {
b.IsAllowed()
for i := 0; i < 49; i++ {
wg.Add(1)
go func() {
defer wg.Done()
if b.IsAllowed() {
atomic.AddInt32(&pass, 1)
} else {
atomic.AddInt32(&fail, 1)
}
assert(t, !b.IsAllowed())
}()
}
wg.Wait()
if pass != 1 {
t.Errorf("want 1 pass but got %d pass", pass)
}
if fail != 49 {
t.Errorf("want 49 fails but got %d fails", fail)
}
}()
}
w.Wait()
Expand Down
16 changes: 9 additions & 7 deletions cloud/circuitbreaker/metricer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,19 @@ func TestMetricser1(t *testing.T) {
}

rate := m.ErrorRate()
assert(t, (rate > .6 && rate < .7))
s = m.Successes()
assert(t, (s > int64(tot/3-1000) && s < int64(tot/3+1000)))
f = m.Failures()
assert(t, (f > int64(tot/3-1000) && f < int64(tot/3+1000)))
ts := m.Timeouts()
assert(t, (ts > int64(tot/3-1000) && ts < int64(tot/3+1000)))
assert(t, rate > .6 && rate < .7)
// it's not guaranteed in unstable ci env
//s = m.Successes()
//assert(t, s > int64(tot/3-1000) && s < int64(tot/3+1000))
//f = m.Failures()
//assert(t, f > int64(tot/3-1000) && f < int64(tot/3+1000))
//ts := m.Timeouts()
//assert(t, ts > int64(tot/3-1000) && ts < int64(tot/3+1000))
}

// TestMetricser2 tests functions about time
func TestMetricser2(t *testing.T) {
t.Skipf("it's not a stable unit tests since depend time stricly")
p, _ := NewPanel(nil, Options{BucketTime: time.Millisecond * 10, BucketNums: 100})
b := p.(*panel).getBreaker("test")
m := b.metricer
Expand Down
8 changes: 4 additions & 4 deletions cloud/circuitbreaker/per_p_metricer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func BenchmarkPerPBuckets(b *testing.B) {
}
}

// TestPerPMetricser1 tests basic functions
func TestPerPMetricser1(t *testing.T) {
// TestPerPMetricer1 tests basic functions
func TestPerPMetricer1(t *testing.T) {
m := newPerPWindow()

// no data
Expand Down Expand Up @@ -86,8 +86,8 @@ func TestPerPMetricser1(t *testing.T) {
assert(t, ts > int64(tot/3-1000) && ts < int64(tot/3+1000))
}

// TestPerPMetricser2 tests functions about time
func TestPerPMetricser2(t *testing.T) {
// TestPerPMetricer2 tests functions about time
func TestPerPMetricer2(t *testing.T) {
p, _ := NewPanel(nil, Options{BucketTime: time.Millisecond * 10, BucketNums: 100})
b := p.(*panel).getBreaker("test")
m := b.metricer
Expand Down
Loading
Loading