Skip to content

Commit 37c2399

Browse files
committed
feat: done benchmark cpu task
1 parent dec9502 commit 37c2399

File tree

34 files changed

+1087
-58
lines changed

34 files changed

+1087
-58
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.idea
1+
.idea
2+
.vendor

0-limit-crawler/check_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//////////////////////////////////////////////////////////////////////
22
//
33
// DO NOT EDIT THIS PART
4-
// Your task is to edit `main.go`
4+
// Your task is to edit `base.go`
55
//
66

77
package main

0-limit-crawler/mockfetcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//////////////////////////////////////////////////////////////////////
22
//
33
// DO NOT EDIT THIS PART
4-
// Your task is to edit `main.go`
4+
// Your task is to edit `base.go`
55
//
66

77
package main

1-producer-consumer/mockstream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//////////////////////////////////////////////////////////////////////
22
//
33
// DO NOT EDIT THIS PART
4-
// Your task is to edit `main.go`
4+
// Your task is to edit `base.go`
55
//
66

77
package main

2-race-in-cache/check_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//////////////////////////////////////////////////////////////////////
22
//
33
// DO NOT EDIT THIS PART
4-
// Your task is to edit `main.go`
4+
// Your task is to edit `base.go`
55
//
66

77
package main
@@ -39,7 +39,7 @@ func TestLRU(t *testing.T) {
3939
wg.Add(1)
4040
go func(i int) {
4141
value := cache.Get("Test" + strconv.Itoa(i))
42-
if value != "Test" + strconv.Itoa(i) {
42+
if value != "Test"+strconv.Itoa(i) {
4343
t.Errorf("Incorrect db response %v", value)
4444
}
4545
wg.Done()

2-race-in-cache/mockdb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//////////////////////////////////////////////////////////////////////
22
//
33
// DO NOT EDIT THIS PART
4-
// Your task is to edit `main.go`
4+
// Your task is to edit `base.go`
55
//
66

77
package main
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
// MockDB used to simulate a database model
15-
type MockDB struct{
15+
type MockDB struct {
1616
Calls int32
1717
}
1818

2-race-in-cache/mockserver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//////////////////////////////////////////////////////////////////////
22
//
33
// DO NOT EDIT THIS PART
4-
// Your task is to edit `main.go`
4+
// Your task is to edit `base.go`
55
//
66

77
package main
@@ -31,7 +31,7 @@ func RunMockServer(cache *KeyStoreCache, t *testing.T) {
3131
go func(i int) {
3232
value := cache.Get("Test" + strconv.Itoa(i))
3333
if t != nil {
34-
if value != "Test" + strconv.Itoa(i) {
34+
if value != "Test"+strconv.Itoa(i) {
3535
t.Errorf("Incorrect db response %v", value)
3636
}
3737
}

3-limit-service-time/mockserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//////////////////////////////////////////////////////////////////////
22
//
33
// DO NOT EDIT THIS PART
4-
// Your task is to edit `main.go`
4+
// Your task is to edit `base.go`
55
//
66

77
package main

4-graceful-sigint/mockprocess.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//////////////////////////////////////////////////////////////////////
22
//
33
// DO NOT EDIT THIS PART
4-
// Your task is to edit `main.go`
4+
// Your task is to edit `base.go`
55
//
66

77
package main
@@ -15,7 +15,7 @@ import (
1515

1616
// MockProcess for example
1717
type MockProcess struct {
18-
mu sync.Mutex
18+
mu sync.Mutex
1919
isRunning bool
2020
}
2121

5-session-cleaner/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//////////////////////////////////////////////////////////////////////
22
//
33
// DO NOT EDIT THIS PART
4-
// Your task is to edit `main.go`
4+
// Your task is to edit `base.go`
55
//
66

77
package main

0 commit comments

Comments
 (0)