benchmarked redis

This commit is contained in:
Radu Ioan Fericean
2012-02-03 21:32:49 +02:00
parent 7f036b7e5a
commit 8785ad93c0

View File

@@ -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")