diff --git a/timespans/activationperiod_test.go b/timespans/activationperiod_test.go index 1dceac552..7fc152a82 100644 --- a/timespans/activationperiod_test.go +++ b/timespans/activationperiod_test.go @@ -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;") diff --git a/timespans/calldesc_test.go b/timespans/calldesc_test.go index d8893ba54..131655f5d 100644 --- a/timespans/calldesc_test.go +++ b/timespans/calldesc_test.go @@ -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")