diff --git a/cmd/stress/cgr-raterstress/cgr-raterstress.go b/cmd/stress/cgr-raterstress/cgr-raterstress.go index 3341d5e41..58eeaa644 100644 --- a/cmd/stress/cgr-raterstress/cgr-raterstress.go +++ b/cmd/stress/cgr-raterstress/cgr-raterstress.go @@ -30,7 +30,7 @@ import ( ) var ( - balancer = flag.String("balancer", "localhost:2001", "balancer server address") + balancer = flag.String("balancer", "localhost:2012", "balancer server address") runs = flag.Int("runs", 10000, "stress cycle number") parallel = flag.Int("parallel", 0, "run n requests in parallel") json = flag.Bool("json", false, "use JSON for RPC encoding") @@ -40,9 +40,9 @@ func main() { flag.Parse() runtime.GOMAXPROCS(runtime.NumCPU()) - 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 := engine.CallDescriptor{Direction: "*out", TOR: "0", Tenant: "vdf", Subject: "rif", Destination: "0256", TimeStart: t1, TimeEnd: t2} + t1 := time.Date(2013, time.August, 07, 17, 30, 0, 0, time.UTC) + t2 := time.Date(2013, time.August, 07, 18, 30, 0, 0, time.UTC) + cd := engine.CallDescriptor{Direction: "*out", TOR: "call", Tenant: "cgrates.org", Subject: "1001", Destination: "+49", TimeStart: t1, TimeEnd: t2} result := engine.CallCost{} var client *rpc.Client var err error @@ -65,7 +65,7 @@ func main() { client.Call("Responder.GetCost", cd, &result) <-sem finish <- 1 - // divCall = client.Go("Responder.GetCost", cd, &result, nil) + // divCall = client.Go("Responder.GetCost", cd, &result, nil) }() } for i := 0; i < *runs; i++ { diff --git a/cmd/stress/cgr-raterstress/cgr-raterstress.py b/cmd/stress/cgr-raterstress/cgr-raterstress.py index 855523afe..dba1bbf37 100644 --- a/cmd/stress/cgr-raterstress/cgr-raterstress.py +++ b/cmd/stress/cgr-raterstress/cgr-raterstress.py @@ -43,15 +43,15 @@ class JSONClient(object): rpc =JSONClient(("127.0.0.1", 2012)) -cd = {"Direction":"*out", "TOR":"0", "Tenant": "vdf", "Subject": "rif", "DestinationPrefix": "0256", "TimeStart": "2012-02-02T17:30:00Z", "TimeEnd": "2012-02-02T18:30:00Z"} +cd = {"Direction":"*out", "TOR":"call", "Tenant": "cgrates.org", "Subject": "1001", "Destination": "+49", "TimeStart": "2013-08-07T17:30:00Z", "TimeEnd": "2013-08-07T18:30:00Z"} # alternative to the above -s = socket.create_connection(("127.0.0.1", 2012)) -s.sendall(json.dumps(({"id": 1, "method": "Responder.GetCost", "params": [cd]}))) -print s.recv(4096) +#s = socket.create_connection(("127.0.0.1", 2012)) +#s.sendall(json.dumps({"id": 1, "method": "Responder.GetCost", "params": [cd]})) +#print(s.recv(4096)) i = 0 result = "" -for i in xrange(int(1e5) + 1): +for i in range(int(1e5) + 1): result = rpc.call("Responder.GetCost", cd) -print i, result +print(i, result) diff --git a/cmd/stress/cgr-spansstress/cgr-spansstress.go b/cmd/stress/cgr-spansstress/cgr-spansstress.go index ceaad72ad..8e20fb360 100644 --- a/cmd/stress/cgr-spansstress/cgr-spansstress.go +++ b/cmd/stress/cgr-spansstress/cgr-spansstress.go @@ -55,9 +55,10 @@ func main() { f.Close() return } - 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 := engine.CallDescriptor{Direction: "*out", TOR: "0", Tenant: "vdf", Subject: "rif", Destination: "0256", TimeStart: t1, TimeEnd: t2} + t1 := time.Date(2013, time.August, 07, 17, 30, 0, 0, time.UTC) + t2 := time.Date(2013, time.August, 07, 18, 30, 0, 0, time.UTC) + //cd := engine.CallDescriptor{Direction: "*out", TOR: "0", Tenant: "vdf", Subject: "rif", Destination: "0256", TimeStart: t1, TimeEnd: t2} + cd := engine.CallDescriptor{Direction: "*out", TOR: "call", Tenant: "cgrates.org", Subject: "rif", Destination: "+49", TimeStart: t1, TimeEnd: t2} getter, err := engine.NewRedisStorage("localhost:6379", 10, "") //getter, err := engine.NewMongoStorage("localhost", "cgrates") diff --git a/data/tariffplans/fs_germany_prep1/Rates.csv b/data/tariffplans/fs_germany_prep1/Rates.csv index a73ca1a27..803b91c3d 100644 --- a/data/tariffplans/fs_germany_prep1/Rates.csv +++ b/data/tariffplans/fs_germany_prep1/Rates.csv @@ -1,7 +1,7 @@ #Tag,ConnectFee,Rate,RateUnit,RateIncrement,GroupIntervalStart,RoundingMethod,RoundingDecimals,Weight -LANDLINE_PEAK,0.02,0.02,60s,60s,0,*up,4,10 +LANDLINE_PEAK,0.02,0.02,60s,60s,0s,*up,4,10 LANDLINE_PEAK,0.02,0.01,1s,1s,60s,*up,4,10 -MOBILE_PEAK,0.02,0.14,60s,60s,0,*up,4,10 -LANDLINE_OFFPEAK,1,0,60s,60s,0,*up,4,10 +MOBILE_PEAK,0.02,0.14,60s,60s,0s,*up,4,10 +LANDLINE_OFFPEAK,1,0,60s,60s,0s,*up,4,10 MOBILE_OFFPEAK,0.02,0.1,60s,60s,0,*up,4,10 -RT_FS_USERS,0,0,60s,60s,0,*up,0,10 +RT_FS_USERS,0,0,60s,60s,0s,*up,0,10 diff --git a/data/tariffplans/prepaid1centpsec/Rates.csv b/data/tariffplans/prepaid1centpsec/Rates.csv index af3295d84..8a5b0de9e 100644 --- a/data/tariffplans/prepaid1centpsec/Rates.csv +++ b/data/tariffplans/prepaid1centpsec/Rates.csv @@ -1,2 +1,2 @@ -#Tag,ConnectFee,Rate,RatedUnits,RateIncrements,GroupInterval,RoundingMethod,RoundingDecimals,Weight -1CENTPERSEC,0,0.01,1,1,0,*middle,4,10 +#Tag,ConnectFee,Rate,RateUnit,RateIncrement,GroupIntervalStart,RoundingMethod,RoundingDecimals,Weight +1CENTPERSEC,0,0.01,1s,1s,0s,*middle,4,10 diff --git a/engine/calldesc.go b/engine/calldesc.go index 63ef0d45b..60ee36878 100644 --- a/engine/calldesc.go +++ b/engine/calldesc.go @@ -290,7 +290,7 @@ func (cd *CallDescriptor) GetCost() (*CallCost, error) { Cost: cost, ConnectFee: connectionFee, Timespans: timespans} - Logger.Info(fmt.Sprintf(" Get Cost: %s => %v", cd.GetKey(), cc)) + //Logger.Info(fmt.Sprintf(" Get Cost: %s => %v", cd.GetKey(), cc)) return cc, err } diff --git a/engine/loader_helpers.go b/engine/loader_helpers.go index 3ac9f3c9e..03e97247d 100644 --- a/engine/loader_helpers.go +++ b/engine/loader_helpers.go @@ -220,8 +220,8 @@ var FileValidators = map[string]*FileLineRegexValidator{ regexp.MustCompile(`(?:\w+\s*,\s*){1}(?:\*any\s*,\s*|(?:\d{1,4};?)+\s*,\s*|\s*,\s*){4}(?:\d{2}:\d{2}:\d{2}|\*asap){1}$`), "Tag([0-9A-Za-z_]),Years([0-9;]|*all|),Months([0-9;]|*all|),MonthDays([0-9;]|*all|),WeekDays([0-9;]|*all|),Time([0-9:]|*asap)"}, utils.RATES_CSV: &FileLineRegexValidator{utils.RATES_NRCOLS, - regexp.MustCompile(`(?:\w+\s*,\s*){1}(?:\d+\.?\d*,){5}(?:\*\w+,){1}(?:\d+\.?\d*,?){2}$`), - "Tag([0-9A-Za-z_]),ConnectFee([0-9.]),Rate([0-9.]),RatedUnits([0-9.]),RateIncrement([0-9.])"}, + regexp.MustCompile(`(?:\w+\s*,\s*){1}(?:\d+\.?\d*,){2}(?:\d+s*,){3}(?:\*\w+,){1}(?:\d+\.?\d*,?){2}$`), + "Tag([0-9A-Za-z_]),ConnectFee([0-9.]),Rate([0-9.]),RateUnit([0-9.]),RateIncrementStart([0-9.])"}, utils.DESTINATION_RATES_CSV: &FileLineRegexValidator{utils.DESTINATION_RATES_NRCOLS, regexp.MustCompile(`(?:\w+\s*,?\s*){3}$`), "Tag([0-9A-Za-z_]),DestinationsTag([0-9A-Za-z_]),RateTag([0-9A-Za-z_])"},