mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
benchmarked redis
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user