diff --git a/timespans/calldesc_test.go b/timespans/calldesc_test.go index c50215bd8..5b59604e1 100644 --- a/timespans/calldesc_test.go +++ b/timespans/calldesc_test.go @@ -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() diff --git a/timespans/kyoto_storage.go b/timespans/kyoto_storage.go index e927b3d7f..431d2db2a 100644 --- a/timespans/kyoto_storage.go +++ b/timespans/kyoto_storage.go @@ -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) diff --git a/timespans/redis_storage.go b/timespans/redis_storage.go index 9b87c4d62..ad82b6ad4 100644 --- a/timespans/redis_storage.go +++ b/timespans/redis_storage.go @@ -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) diff --git a/timespans/tariff_plans.go b/timespans/tariff_plans.go index 3b2d8115b..fb642f5a8 100644 --- a/timespans/tariff_plans.go +++ b/timespans/tariff_plans.go @@ -18,7 +18,7 @@ along with this program. If not, see package timespans import ( - // "log" +// "log" ) /* diff --git a/timespans/test.kch b/timespans/test.kch index 55fd81e2c..fc90c15bd 100644 Binary files a/timespans/test.kch and b/timespans/test.kch differ