Skip to content

Commit

Permalink
Update function related comments
Browse files Browse the repository at this point in the history
  • Loading branch information
krapie committed Jan 11, 2024
1 parent b5d883b commit 6ad2ca3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/backend/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ type Database interface {
// after handling PushPull.
UpdateClientInfoAfterPushPull(ctx context.Context, clientInfo *ClientInfo, docInfo *DocInfo) error

// FindNextNCyclingProjectInfos returns all project infos rotationally.
// FindNextNCyclingProjectInfos finds the next N cycling projects from the given projectID.
FindNextNCyclingProjectInfos(
ctx context.Context,
pageSize int,
Expand Down
2 changes: 1 addition & 1 deletion server/backend/database/memory/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (d *DB) CreateProjectInfo(
return info, nil
}

// FindNextNCyclingProjectInfos returns all project infos rotationally.
// FindNextNCyclingProjectInfos finds the next N cycling projects from the given projectID.
func (d *DB) FindNextNCyclingProjectInfos(
_ context.Context,
pageSize int,
Expand Down
2 changes: 1 addition & 1 deletion server/backend/database/mongo/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (c *Client) CreateProjectInfo(
return info, nil
}

// FindNextNCyclingProjectInfos returns all project infos rotationally.
// FindNextNCyclingProjectInfos finds the next N cycling projects from the given projectID.
func (c *Client) FindNextNCyclingProjectInfos(
ctx context.Context,
pageSize int,
Expand Down
5 changes: 3 additions & 2 deletions test/integration/housekeeping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
monkey "github.com/undefinedlabs/go-mpatch"

"github.com/stretchr/testify/assert"

"github.com/yorkie-team/yorkie/api/types"
"github.com/yorkie-team/yorkie/server/backend/database"
"github.com/yorkie-team/yorkie/server/backend/database/mongo"
Expand Down Expand Up @@ -71,7 +72,7 @@ func TestHousekeeping(t *testing.T) {
h, err := housekeeping.New(config.Housekeeping, db, coordinator)
assert.NoError(t, err)

t.Run("FindDeactivateCandidates return value(lastProjectID) test", func(t *testing.T) {
t.Run("FindDeactivateCandidates return lastProjectID test", func(t *testing.T) {
ctx := context.Background()

fetchSize := 3
Expand All @@ -98,7 +99,7 @@ func TestHousekeeping(t *testing.T) {
assert.Equal(t, projects[fetchSize-(len(projects)%3)-1].ID, lastProjectID)
})

t.Run("FindDeactivateCandidates return value(clients) test", func(t *testing.T) {
t.Run("FindDeactivateCandidates return clients test", func(t *testing.T) {
ctx := context.Background()

yesterday := gotime.Now().Add(-24 * gotime.Hour)
Expand Down

1 comment on commit 6ad2ca3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go Benchmark

Benchmark suite Current: 6ad2ca3 Previous: 371c0bd Ratio
BenchmarkDocument/constructor_test - ns/op 1378 ns/op 1377 ns/op 1.00
BenchmarkDocument/constructor_test - B/op 1208 B/op 1208 B/op 1
BenchmarkDocument/constructor_test - allocs/op 20 allocs/op 20 allocs/op 1
BenchmarkDocument/status_test - ns/op 775.8 ns/op 789.4 ns/op 0.98
BenchmarkDocument/status_test - B/op 1176 B/op 1176 B/op 1
BenchmarkDocument/status_test - allocs/op 18 allocs/op 18 allocs/op 1
BenchmarkDocument/equals_test - ns/op 7089 ns/op 7111 ns/op 1.00
BenchmarkDocument/equals_test - B/op 6913 B/op 6913 B/op 1
BenchmarkDocument/equals_test - allocs/op 120 allocs/op 120 allocs/op 1
BenchmarkDocument/nested_update_test - ns/op 16093 ns/op 16193 ns/op 0.99
BenchmarkDocument/nested_update_test - B/op 11962 B/op 11963 B/op 1.00
BenchmarkDocument/nested_update_test - allocs/op 254 allocs/op 254 allocs/op 1
BenchmarkDocument/delete_test - ns/op 24994 ns/op 21946 ns/op 1.14
BenchmarkDocument/delete_test - B/op 15188 B/op 15188 B/op 1
BenchmarkDocument/delete_test - allocs/op 333 allocs/op 333 allocs/op 1
BenchmarkDocument/object_test - ns/op 8306 ns/op 8312 ns/op 1.00
BenchmarkDocument/object_test - B/op 6721 B/op 6721 B/op 1
BenchmarkDocument/object_test - allocs/op 116 allocs/op 116 allocs/op 1
BenchmarkDocument/array_test - ns/op 28389 ns/op 30000 ns/op 0.95
BenchmarkDocument/array_test - B/op 11819 B/op 11819 B/op 1
BenchmarkDocument/array_test - allocs/op 270 allocs/op 270 allocs/op 1
BenchmarkDocument/text_test - ns/op 30472 ns/op 30139 ns/op 1.01
BenchmarkDocument/text_test - B/op 14883 B/op 14795 B/op 1.01
BenchmarkDocument/text_test - allocs/op 468 allocs/op 468 allocs/op 1
BenchmarkDocument/text_composition_test - ns/op 28657 ns/op 28335 ns/op 1.01
BenchmarkDocument/text_composition_test - B/op 18398 B/op 18276 B/op 1.01
BenchmarkDocument/text_composition_test - allocs/op 477 allocs/op 477 allocs/op 1
BenchmarkDocument/rich_text_test - ns/op 79792 ns/op 79995 ns/op 1.00
BenchmarkDocument/rich_text_test - B/op 38644 B/op 38540 B/op 1.00
BenchmarkDocument/rich_text_test - allocs/op 1147 allocs/op 1147 allocs/op 1
BenchmarkDocument/counter_test - ns/op 16689 ns/op 16569 ns/op 1.01
BenchmarkDocument/counter_test - B/op 10210 B/op 10210 B/op 1
BenchmarkDocument/counter_test - allocs/op 236 allocs/op 236 allocs/op 1
BenchmarkDocument/text_edit_gc_100 - ns/op 2897359 ns/op 2880237 ns/op 1.01
BenchmarkDocument/text_edit_gc_100 - B/op 1658507 B/op 1655338 B/op 1.00
BenchmarkDocument/text_edit_gc_100 - allocs/op 17092 allocs/op 17093 allocs/op 1.00
BenchmarkDocument/text_edit_gc_1000 - ns/op 230791413 ns/op 230665534 ns/op 1.00
BenchmarkDocument/text_edit_gc_1000 - B/op 144381795 B/op 144353982 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 200938 allocs/op 200922 allocs/op 1.00
BenchmarkDocument/text_split_gc_100 - ns/op 3378690 ns/op 3364482 ns/op 1.00
BenchmarkDocument/text_split_gc_100 - B/op 2317134 B/op 2313691 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 16197 allocs/op 16194 allocs/op 1.00
BenchmarkDocument/text_split_gc_1000 - ns/op 289302268 ns/op 287958336 ns/op 1.00
BenchmarkDocument/text_split_gc_1000 - B/op 228938492 B/op 228907444 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 204002 allocs/op 204038 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 - ns/op 10949359 ns/op 10745732 ns/op 1.02
BenchmarkDocument/text_delete_all_10000 - B/op 5811119 B/op 5811042 B/op 1.00
BenchmarkDocument/text_delete_all_10000 - allocs/op 40678 allocs/op 40677 allocs/op 1.00
BenchmarkDocument/text_delete_all_100000 - ns/op 185313312 ns/op 182654438 ns/op 1.01
BenchmarkDocument/text_delete_all_100000 - B/op 81894240 B/op 81901874 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 411589 allocs/op 411632 allocs/op 1.00
BenchmarkDocument/text_100 - ns/op 219521 ns/op 233058 ns/op 0.94
BenchmarkDocument/text_100 - B/op 120107 B/op 118483 B/op 1.01
BenchmarkDocument/text_100 - allocs/op 5080 allocs/op 5080 allocs/op 1
BenchmarkDocument/text_1000 - ns/op 2395140 ns/op 2391484 ns/op 1.00
BenchmarkDocument/text_1000 - B/op 1169092 B/op 1153070 B/op 1.01
BenchmarkDocument/text_1000 - allocs/op 50084 allocs/op 50084 allocs/op 1
BenchmarkDocument/array_1000 - ns/op 1179079 ns/op 1224286 ns/op 0.96
BenchmarkDocument/array_1000 - B/op 1091233 B/op 1091326 B/op 1.00
BenchmarkDocument/array_1000 - allocs/op 11825 allocs/op 11826 allocs/op 1.00
BenchmarkDocument/array_10000 - ns/op 12991978 ns/op 13077903 ns/op 0.99
BenchmarkDocument/array_10000 - B/op 9799691 B/op 9800290 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120290 allocs/op 120292 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 145683 ns/op 151788 ns/op 0.96
BenchmarkDocument/array_gc_100 - B/op 132500 B/op 132488 B/op 1.00
BenchmarkDocument/array_gc_100 - allocs/op 1249 allocs/op 1248 allocs/op 1.00
BenchmarkDocument/array_gc_1000 - ns/op 1379567 ns/op 1404854 ns/op 0.98
BenchmarkDocument/array_gc_1000 - B/op 1158990 B/op 1158980 B/op 1.00
BenchmarkDocument/array_gc_1000 - allocs/op 12865 allocs/op 12865 allocs/op 1
BenchmarkDocument/counter_1000 - ns/op 201340 ns/op 206194 ns/op 0.98
BenchmarkDocument/counter_1000 - B/op 192853 B/op 192853 B/op 1
BenchmarkDocument/counter_1000 - allocs/op 5765 allocs/op 5765 allocs/op 1
BenchmarkDocument/counter_10000 - ns/op 2175688 ns/op 2162242 ns/op 1.01
BenchmarkDocument/counter_10000 - B/op 2087782 B/op 2087767 B/op 1.00
BenchmarkDocument/counter_10000 - allocs/op 59772 allocs/op 59772 allocs/op 1
BenchmarkDocument/object_1000 - ns/op 1338176 ns/op 1387175 ns/op 0.96
BenchmarkDocument/object_1000 - B/op 1428042 B/op 1427873 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9845 allocs/op 9844 allocs/op 1.00
BenchmarkDocument/object_10000 - ns/op 14731614 ns/op 14940872 ns/op 0.99
BenchmarkDocument/object_10000 - B/op 12168130 B/op 12167844 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 100564 allocs/op 100565 allocs/op 1.00
BenchmarkDocument/tree_100 - ns/op 1010053 ns/op 1063528 ns/op 0.95
BenchmarkDocument/tree_100 - B/op 943673 B/op 943676 B/op 1.00
BenchmarkDocument/tree_100 - allocs/op 6099 allocs/op 6099 allocs/op 1
BenchmarkDocument/tree_1000 - ns/op 71605468 ns/op 76919106 ns/op 0.93
BenchmarkDocument/tree_1000 - B/op 86460808 B/op 86460483 B/op 1.00
BenchmarkDocument/tree_1000 - allocs/op 60113 allocs/op 60113 allocs/op 1
BenchmarkDocument/tree_10000 - ns/op 9508751300 ns/op 9455598211 ns/op 1.01
BenchmarkDocument/tree_10000 - B/op 8580983352 B/op 8580974952 B/op 1.00
BenchmarkDocument/tree_10000 - allocs/op 600243 allocs/op 600241 allocs/op 1.00
BenchmarkDocument/tree_delete_all_1000 - ns/op 73789762 ns/op 76041550 ns/op 0.97
BenchmarkDocument/tree_delete_all_1000 - B/op 86990994 B/op 86990093 B/op 1.00
BenchmarkDocument/tree_delete_all_1000 - allocs/op 67753 allocs/op 67750 allocs/op 1.00
BenchmarkDocument/tree_edit_gc_100 - ns/op 3653914 ns/op 3788184 ns/op 0.96
BenchmarkDocument/tree_edit_gc_100 - B/op 4120990 B/op 4120975 B/op 1.00
BenchmarkDocument/tree_edit_gc_100 - allocs/op 14356 allocs/op 14356 allocs/op 1
BenchmarkDocument/tree_edit_gc_1000 - ns/op 299079252 ns/op 311628432 ns/op 0.96
BenchmarkDocument/tree_edit_gc_1000 - B/op 383465988 B/op 383466072 B/op 1.00
BenchmarkDocument/tree_edit_gc_1000 - allocs/op 145407 allocs/op 145408 allocs/op 1.00
BenchmarkDocument/tree_split_gc_100 - ns/op 2453888 ns/op 2537211 ns/op 0.97
BenchmarkDocument/tree_split_gc_100 - B/op 2386859 B/op 2386834 B/op 1.00
BenchmarkDocument/tree_split_gc_100 - allocs/op 10341 allocs/op 10341 allocs/op 1
BenchmarkDocument/tree_split_gc_1000 - ns/op 178137660 ns/op 186579060 ns/op 0.95
BenchmarkDocument/tree_split_gc_1000 - B/op 221989948 B/op 221992948 B/op 1.00
BenchmarkDocument/tree_split_gc_1000 - allocs/op 112245 allocs/op 112269 allocs/op 1.00
BenchmarkRPC/client_to_server - ns/op 359468258 ns/op 357207335 ns/op 1.01
BenchmarkRPC/client_to_server - B/op 18092890 B/op 17780002 B/op 1.02
BenchmarkRPC/client_to_server - allocs/op 166894 allocs/op 166893 allocs/op 1.00
BenchmarkRPC/client_to_client_via_server - ns/op 612425176 ns/op 609889492 ns/op 1.00
BenchmarkRPC/client_to_client_via_server - B/op 32040088 B/op 36970424 B/op 0.87
BenchmarkRPC/client_to_client_via_server - allocs/op 312351 allocs/op 312196 allocs/op 1.00
BenchmarkRPC/attach_large_document - ns/op 1410630699 ns/op 1311110292 ns/op 1.08
BenchmarkRPC/attach_large_document - B/op 1879554224 B/op 1890028136 B/op 0.99
BenchmarkRPC/attach_large_document - allocs/op 7590 allocs/op 7522 allocs/op 1.01
BenchmarkRPC/adminCli_to_server - ns/op 539556308 ns/op 542890036 ns/op 0.99
BenchmarkRPC/adminCli_to_server - B/op 36393664 B/op 35988828 B/op 1.01
BenchmarkRPC/adminCli_to_server - allocs/op 289671 allocs/op 289666 allocs/op 1.00
BenchmarkLocker - ns/op 65.42 ns/op 68.75 ns/op 0.95
BenchmarkLocker - B/op 16 B/op 16 B/op 1
BenchmarkLocker - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkLockerParallel - ns/op 38.74 ns/op 40.48 ns/op 0.96
BenchmarkLockerParallel - B/op 0 B/op 0 B/op NaN
BenchmarkLockerParallel - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkLockerMoreKeys - ns/op 155.2 ns/op 147.6 ns/op 1.05
BenchmarkLockerMoreKeys - B/op 15 B/op 15 B/op 1
BenchmarkLockerMoreKeys - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkChange/Push_10_Changes - ns/op 3778534 ns/op 3805155 ns/op 0.99
BenchmarkChange/Push_10_Changes - B/op 125894 B/op 126109 B/op 1.00
BenchmarkChange/Push_10_Changes - allocs/op 1253 allocs/op 1248 allocs/op 1.00
BenchmarkChange/Push_100_Changes - ns/op 14213063 ns/op 14183166 ns/op 1.00
BenchmarkChange/Push_100_Changes - B/op 642202 B/op 642196 B/op 1.00
BenchmarkChange/Push_100_Changes - allocs/op 6537 allocs/op 6533 allocs/op 1.00
BenchmarkChange/Push_1000_Changes - ns/op 113515316 ns/op 113839698 ns/op 1.00
BenchmarkChange/Push_1000_Changes - B/op 5948182 B/op 6143264 B/op 0.97
BenchmarkChange/Push_1000_Changes - allocs/op 62159 allocs/op 62159 allocs/op 1
BenchmarkChange/Pull_10_Changes - ns/op 2835467 ns/op 2849854 ns/op 0.99
BenchmarkChange/Pull_10_Changes - B/op 100744 B/op 100526 B/op 1.00
BenchmarkChange/Pull_10_Changes - allocs/op 952 allocs/op 952 allocs/op 1
BenchmarkChange/Pull_100_Changes - ns/op 4322052 ns/op 4343669 ns/op 1.00
BenchmarkChange/Pull_100_Changes - B/op 258125 B/op 257709 B/op 1.00
BenchmarkChange/Pull_100_Changes - allocs/op 3154 allocs/op 3154 allocs/op 1
BenchmarkChange/Pull_1000_Changes - ns/op 8366971 ns/op 8312148 ns/op 1.01
BenchmarkChange/Pull_1000_Changes - B/op 1398053 B/op 1399193 B/op 1.00
BenchmarkChange/Pull_1000_Changes - allocs/op 26869 allocs/op 26872 allocs/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - ns/op 16715810 ns/op 16961319 ns/op 0.99
BenchmarkSnapshot/Push_3KB_snapshot - B/op 808430 B/op 808475 B/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op 6542 allocs/op 6543 allocs/op 1.00
BenchmarkSnapshot/Push_30KB_snapshot - ns/op 116878633 ns/op 118594721 ns/op 0.99
BenchmarkSnapshot/Push_30KB_snapshot - B/op 6191577 B/op 6352788 B/op 0.97
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op 62168 allocs/op 62161 allocs/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op 6603431 ns/op 6716744 ns/op 0.98
BenchmarkSnapshot/Pull_3KB_snapshot - B/op 905446 B/op 904978 B/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - allocs/op 14881 allocs/op 14877 allocs/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - ns/op 14819871 ns/op 15139900 ns/op 0.98
BenchmarkSnapshot/Pull_30KB_snapshot - B/op 6992895 B/op 6988512 B/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op 144141 allocs/op 144138 allocs/op 1.00
BenchmarkSync/memory_sync_10_test - ns/op 6771 ns/op 6857 ns/op 0.99
BenchmarkSync/memory_sync_10_test - B/op 1286 B/op 1286 B/op 1
BenchmarkSync/memory_sync_10_test - allocs/op 38 allocs/op 38 allocs/op 1
BenchmarkSync/memory_sync_100_test - ns/op 51775 ns/op 52028 ns/op 1.00
BenchmarkSync/memory_sync_100_test - B/op 8639 B/op 8648 B/op 1.00
BenchmarkSync/memory_sync_100_test - allocs/op 273 allocs/op 273 allocs/op 1
BenchmarkSync/memory_sync_1000_test - ns/op 589996 ns/op 589322 ns/op 1.00
BenchmarkSync/memory_sync_1000_test - B/op 74387 B/op 74649 B/op 1.00
BenchmarkSync/memory_sync_1000_test - allocs/op 2113 allocs/op 2127 allocs/op 0.99
BenchmarkSync/memory_sync_10000_test - ns/op 6887171 ns/op 7070870 ns/op 0.97
BenchmarkSync/memory_sync_10000_test - B/op 762261 B/op 756421 B/op 1.01
BenchmarkSync/memory_sync_10000_test - allocs/op 20613 allocs/op 20513 allocs/op 1.00
BenchmarkTextEditing - ns/op 18816868339 ns/op 18441616550 ns/op 1.02
BenchmarkTextEditing - B/op 9041528904 B/op 9037573648 B/op 1.00
BenchmarkTextEditing - allocs/op 19920803 allocs/op 19921799 allocs/op 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.