mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
cod fromatting
This commit is contained in:
@@ -23,6 +23,18 @@ import (
|
||||
//"log"
|
||||
)
|
||||
|
||||
/*
|
||||
json
|
||||
BenchmarkRedisGetCost 5000 462787 ns/op
|
||||
BenchmarkKyotoGetCost 10000 203543 ns/op
|
||||
BenchmarkMongoGetCost 10000 320457 ns/op
|
||||
|
||||
gob
|
||||
BenchmarkRedisGetCost 10000 258751 ns/op
|
||||
BenchmarkKyotoGetCost 50000 38449 ns/op
|
||||
BenchmarkMongoGetCost 10000 323262 ns/op
|
||||
*/
|
||||
|
||||
func TestKyotoSplitSpans(t *testing.T) {
|
||||
getter, _ := NewKyotoStorage("test.kch")
|
||||
defer getter.Close()
|
||||
|
||||
@@ -41,11 +41,11 @@ func NewKyotoStorage(filaName string) (*KyotoStorage, error) {
|
||||
|
||||
ks.dec = gob.NewDecoder(&ks.buf)
|
||||
ks.enc = gob.NewEncoder(&ks.buf)
|
||||
ks.trainGobEncoderAndDecoder()
|
||||
ks.traingobEncoderAndDecoder()
|
||||
return ks, err
|
||||
}
|
||||
|
||||
func (ks *KyotoStorage) trainGobEncoderAndDecoder() {
|
||||
func (ks *KyotoStorage) traingobEncoderAndDecoder() {
|
||||
aps := []*ActivationPeriod{&ActivationPeriod{}}
|
||||
ks.enc.Encode(aps)
|
||||
ks.dec.Decode(&aps)
|
||||
|
||||
@@ -39,11 +39,11 @@ func NewRedisStorage(address string, db int) (*RedisStorage, error) {
|
||||
rs := &RedisStorage{db: ndb, dbNb: db}
|
||||
rs.dec = gob.NewDecoder(&rs.buf)
|
||||
rs.enc = gob.NewEncoder(&rs.buf)
|
||||
rs.trainGobEncoderAndDecoder()
|
||||
rs.traingobEncoderAndDecoder()
|
||||
return rs, nil
|
||||
}
|
||||
|
||||
func (rs *RedisStorage) trainGobEncoderAndDecoder() {
|
||||
func (rs *RedisStorage) traingobEncoderAndDecoder() {
|
||||
aps := []*ActivationPeriod{&ActivationPeriod{}}
|
||||
rs.enc.Encode(aps)
|
||||
rs.dec.Decode(&aps)
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package timespans
|
||||
|
||||
import (
|
||||
// "log"
|
||||
// "log"
|
||||
)
|
||||
|
||||
/*
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user