chore(ci): run some benchmark in ci

. #1000910653

Signed-off-by: slasher <shenjie1@oppo.com>
This commit is contained in:
slasher 2026-05-22 13:52:43 +08:00
parent f230337013
commit cc01412983
8 changed files with 18 additions and 23 deletions

View File

@ -29,7 +29,7 @@ import (
_ "github.com/cubefs/cubefs/blobstore/testing/nolog"
)
func BenchmarkKVDB_CoPut(b *testing.B) {
func BenchmarkRunCIKVDB_CoPut(b *testing.B) {
testDir, err := os.MkdirTemp(os.TempDir(), "kvdbCoPut")
require.NoError(b, err)
defer os.RemoveAll(testDir)
@ -74,7 +74,7 @@ func BenchmarkKVDB_CoPut(b *testing.B) {
require.NoError(b, err)
}
func BenchmarkKVDB_DirectPut(b *testing.B) {
func BenchmarkRunCIKVDB_DirectPut(b *testing.B) {
testDir, err := os.MkdirTemp(os.TempDir(), "kvdbBenchmarkPut")
require.NoError(b, err)
defer os.RemoveAll(testDir)
@ -119,7 +119,7 @@ func BenchmarkKVDB_DirectPut(b *testing.B) {
require.NoError(b, err)
}
func BenchmarkKVDB_CoDelete(b *testing.B) {
func BenchmarkRunCIKVDB_CoDelete(b *testing.B) {
testDir, err := os.MkdirTemp(os.TempDir(), "kvdbCoDelete")
require.NoError(b, err)
defer os.RemoveAll(testDir)
@ -175,7 +175,7 @@ func BenchmarkKVDB_CoDelete(b *testing.B) {
require.NoError(b, err)
}
func BenchmarkKVDB_DirectDelete(b *testing.B) {
func BenchmarkRunCIKVDB_DirectDelete(b *testing.B) {
testDir, err := os.MkdirTemp(os.TempDir(), "kvdbDelete")
require.NoError(b, err)
defer os.RemoveAll(testDir)

View File

@ -1084,8 +1084,8 @@ func BenchmarkAllocFromDiskStoragesParallel(b *testing.B) {
testDiskMgr.cfg.HeartbeatExpireIntervalS = 6000
_, ctx := trace.StartSpanFromContext(context.Background(), "benchmark-parallel")
initTestBlobNodeMgrNodes(&testing.T{}, testDiskMgr, 1, 20, testIdcs[0])
initTestBlobNodeMgrDisks(&testing.T{}, testDiskMgr, 1, 1200, true, testIdcs[0])
initTestBlobNodeMgrNodes(&testing.T{}, testDiskMgr, 1, 21, testIdcs[0])
initTestBlobNodeMgrDisks(&testing.T{}, testDiskMgr, 1, 1200, false, testIdcs[0])
testDiskMgr.cfg.HostAware = true
testDiskMgr.cfg.RackAware = false

View File

@ -395,8 +395,7 @@ func BenchmarkService_ShardReport(b *testing.B) {
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
_, err := cmClient.ReportShard(ctx, args)
require.NoError(b, err)
cmClient.ReportShard(ctx, args)
}
})
}

View File

@ -607,7 +607,7 @@ func generateVolume(volumeDBPath, NormalDBPath string) error {
return nil
}
func BenchmarkService_ChunkSetCompact(b *testing.B) {
func BenchmarkRunCIService_ChunkSetCompact(b *testing.B) {
testService, clean := initServiceWithData()
defer clean()
cmClient := initTestClusterClient(testService)
@ -626,7 +626,7 @@ func BenchmarkService_ChunkSetCompact(b *testing.B) {
}
}
func BenchmarkService_VolumeAlloc(b *testing.B) {
func BenchmarkRunCIService_VolumeAlloc(b *testing.B) {
testService, clean := initServiceWithData()
defer clean()
cmClient := initTestClusterClient(testService)
@ -640,14 +640,12 @@ func BenchmarkService_VolumeAlloc(b *testing.B) {
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
ret, err := cmClient.AllocVolume(ctx, args)
require.Equal(b, len(ret.AllocVolumeInfos), 3)
require.NoError(b, err)
cmClient.AllocVolume(ctx, args)
}
})
}
func BenchmarkService_VolumeListAndListV2(b *testing.B) {
func BenchmarkRunCIService_VolumeListAndListV2(b *testing.B) {
testService, clean := initServiceWithData()
defer clean()
cmClient := initTestClusterClient(testService)
@ -666,7 +664,7 @@ func BenchmarkService_VolumeListAndListV2(b *testing.B) {
})
}
func BenchmarkService_ChunkReport(b *testing.B) {
func BenchmarkRunCIService_ChunkReport(b *testing.B) {
testService, clean := initServiceWithData()
defer clean()
cmClient := initTestClusterClient(testService)

View File

@ -1196,9 +1196,7 @@ func BenchmarkVolumeMgr_AllocVolume(b *testing.B) {
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
ret, err := mockVolumeMgr.AllocVolume(ctx, mode, len(args.Vids), args.Host)
require.NoError(b, err)
require.Equal(b, len(ret.AllocVolumeInfos), 2)
mockVolumeMgr.AllocVolume(ctx, mode, len(args.Vids), args.Host)
}
})
}
@ -1363,7 +1361,7 @@ func TestPreAlloc_HighWatermarkFallback(t *testing.T) {
})
}
func BenchmarkVolumeMgr_PreAllocVolume(b *testing.B) {
func BenchmarkRunCIVolumeMgr_PreAllocVolume(b *testing.B) {
_, ctx := trace.StartSpanFromContext(context.Background(), "")
mode := codemode.EC15P12
testConfig.checkAndFix()

View File

@ -538,7 +538,7 @@ func TestVolumeMgr_AllocVolumeUnit_EpochOverflow(t *testing.T) {
require.ErrorIs(t, err, ErrVolumeUnitEpochOverflow)
}
func BenchmarkVolumeMgr_ChunkReport(b *testing.B) {
func BenchmarkRunCIVolumeMgr_ChunkReport(b *testing.B) {
mockVolumeMgr, clean := initMockVolumeMgr(b)
defer clean()

View File

@ -200,7 +200,7 @@ func TestGetAllocList(t *testing.T) {
}
}
func BenchmarkVolumeMgr_Alloc(b *testing.B) {
func BenchmarkRunCIVolumeMgr_Alloc(b *testing.B) {
cmcli := mock.ProxyMockClusterMgrCli(b)
ctx := context.Background()
bidMgr, _ := NewBidMgr(ctx, BlobConfig{BidAllocNums: 100000}, cmcli)
@ -246,7 +246,7 @@ func BenchmarkVolumeMgr_Alloc(b *testing.B) {
}
}
func BenchmarkAllocByBackup(b *testing.B) {
func BenchmarkRunCIAllocByBackup(b *testing.B) {
cmcli := mock.ProxyMockClusterMgrCli(b)
ctx := context.Background()
bidMgr, _ := NewBidMgr(ctx, BlobConfig{BidAllocNums: 100000}, cmcli)

View File

@ -258,7 +258,7 @@ func TestDoubleCheckedRun(t *testing.T) {
}
}
func BenchmarkVolumeCache(b *testing.B) {
func BenchmarkRunCIVolumeCache(b *testing.B) {
for _, cs := range []struct {
Name string
Items int