From 9e3b9ef191253167d686ef9017bdcf33d4022322 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Thu, 1 Mar 2012 21:17:42 +0200 Subject: [PATCH] cod fromatting --- timespans/calldesc_test.go | 12 ++++++++++++ timespans/kyoto_storage.go | 4 ++-- timespans/redis_storage.go | 4 ++-- timespans/tariff_plans.go | 2 +- timespans/test.kch | Bin 6299896 -> 6299272 bytes 5 files changed, 17 insertions(+), 5 deletions(-) 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 55fd81e2ce891e7348b9a83179927fe45d85f799..fc90c15bd744926ab7d9c0727633e53b2b52437a 100644 GIT binary patch delta 438 zcmbW!xlTe+6op|p*DI44DicCN12PK;j-Y~~;DF$W;>dl2^9WE7C^@0rK`m@qMyLR zB3N12+lUB$39YTve-_0E4*cG{VcvTT%*kCwdB4vnr}a*cEx$z7yWuY@S2a!bAiozn z(zCjh)8&A1d~V24V226~4iv$OVz}T&$?dsOTJa#;y+0#HjU$m2QclQS#*L_aQrybp ze|NuC|7STNT}>Xprm9hcTGXK)4QNCYn$dz*w4oh-bf6Pm=tclN=tUp;F@Qk?5yB9L z5yl8c5y2S7F@gM>rZ9~e%wi7nSimBdpko;;Sj8IFv4JRJ*hCy#*v8K7Yic)gZNB(K ztjTVD+;?z|93&Iz#P0s#UNRm2Jd<1nXVdfvzifLmpM4^pZ;t*Av0ANgmKw6A1V1k& V)ykxgKv?z4=7mo*J8W-O?H3p%>@WZT