diff --git a/timespans/calldesc_test.go b/timespans/calldesc_test.go index 4dba52289..9c398e8d9 100644 --- a/timespans/calldesc_test.go +++ b/timespans/calldesc_test.go @@ -72,7 +72,7 @@ func TestRedisGetCost(t *testing.T) { } } -func BenchmarkGetCost(b *testing.B) { +func BenchmarkKyotoGetCost(b *testing.B) { b.StopTimer() getter, _ := NewKyotoStorage("test.kch") defer getter.Close() @@ -86,6 +86,20 @@ func BenchmarkGetCost(b *testing.B) { } } +func BenchmarkRedisGetCost(b *testing.B) { + b.StopTimer() + getter, _ := NewRedisStorage("", 10) + defer getter.Close() + + t1 := time.Date(2012, time.February, 02, 17, 30, 0, 0, time.UTC) + t2 := time.Date(2012, time.February, 02, 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.GetCost(getter) + } +} + func BenchmarkDecoding(b *testing.B) { b.StopTimer() getter, _ := NewKyotoStorage("test.kch")