mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
better benchmarks
This commit is contained in:
@@ -57,7 +57,7 @@ func TestApStoreRestore(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkRestore(b *testing.B) {
|
||||
func BenchmarkActivationPeriodRestore(b *testing.B) {
|
||||
ap1 := ActivationPeriod{}
|
||||
for i := 0; i < b.N; i++ {
|
||||
ap1.restore("1328106601;2|1|3,4|14:30:00|15:00:00|0|0|0|0;")
|
||||
|
||||
@@ -155,6 +155,20 @@ func BenchmarkRedisGetting(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkRedisRestoring(b *testing.B) {
|
||||
b.StopTimer()
|
||||
getter, _ := NewRedisStorage("", 10)
|
||||
defer getter.Close()
|
||||
|
||||
t1 := time.Date(2012, time.February, 2, 17, 30, 0, 0, time.UTC)
|
||||
t2 := time.Date(2012, time.February, 2, 18, 30, 0, 0, time.UTC)
|
||||
cd := &CallDescriptor{CstmId: "vdf", Subject: "rif", DestinationPrefix: "0256", TimeStart: t1, TimeEnd: t2}
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
cd.RestoreFromStorage(getter)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkRedisGetCost(b *testing.B) {
|
||||
b.StopTimer()
|
||||
getter, _ := NewRedisStorage("", 10)
|
||||
@@ -184,6 +198,20 @@ func BenchmarkKyotoGetting(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkKyotoRestoring(b *testing.B) {
|
||||
b.StopTimer()
|
||||
getter, _ := NewKyotoStorage("test.kch")
|
||||
defer getter.Close()
|
||||
|
||||
t1 := time.Date(2012, time.February, 2, 17, 30, 0, 0, time.UTC)
|
||||
t2 := time.Date(2012, time.February, 2, 18, 30, 0, 0, time.UTC)
|
||||
cd := &CallDescriptor{CstmId: "vdf", Subject: "rif", DestinationPrefix: "0256", TimeStart: t1, TimeEnd: t2}
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
cd.RestoreFromStorage(getter)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkSplitting(b *testing.B) {
|
||||
b.StopTimer()
|
||||
getter, _ := NewKyotoStorage("test.kch")
|
||||
|
||||
Reference in New Issue
Block a user