From b5715f2a51b2e5a755446bc711b49395c7e7c815 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Mon, 19 Mar 2012 17:32:43 +0200 Subject: [PATCH] described the parameters of activation periods and destinations --- cmd/stress/spansstress/spansstress.go | 5 +++ docs/tutorial.rst | 47 +++++++++++++++++++++++++-- timespans/activationperiod.go | 1 - 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/cmd/stress/spansstress/spansstress.go b/cmd/stress/spansstress/spansstress.go index f2e6b79d4..93347abde 100644 --- a/cmd/stress/spansstress/spansstress.go +++ b/cmd/stress/spansstress/spansstress.go @@ -24,6 +24,7 @@ import ( "os" "runtime/pprof" "time" + "runtime" ) var ( @@ -63,4 +64,8 @@ func main() { } log.Print(result, j, err) + memstats := new(runtime.MemStats) + runtime.ReadMemStats(memstats) + log.Printf("memstats before GC: Kbytes = %d footprint = %d", + memstats.HeapAlloc/1024, memstats.Sys/1024) } diff --git a/docs/tutorial.rst b/docs/tutorial.rst index bfccee304..db0eb3168 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -123,7 +123,7 @@ Data importing "StartTime":"","EndTime":"","WeekDays":[6,0]} ] }, - {"ActivationTime": "2012-02-08T00:00:00Z", "Intervals": [ + {"ActivationTime": "2012-02-08T00:00:00Z", "Intervals": [ {"BillingUnit":60,"ConnectFee":0,"Month":0,"MonthDay":0,"Ponder":0,"Price":10, "StartTime":"","EndTime":"18:00:00","WeekDays":[1,2,3,4,5]}, {"BillingUnit":60,"ConnectFee":0,"Month":0,"MonthDay":0,"Ponder":0,"Price":1, @@ -132,10 +132,43 @@ Data importing "StartTime":"","EndTime":"","WeekDays":[6,0]} ] } - ] + ] } -The above snippet describes prices for subject "rif" and destination "0257". There are two activation periods, the first one is active starting 2012-01-01 and the second one starting from 2012-02-08. Each deine multiple intervals with different prices for various time periods. +The above snippet describes prices for subject "rif" and destination "0257". There are two activation periods, the first one is active starting 2012-01-01 and the second one starting from 2012-02-08. Each define multiple intervals with different prices for various time periods. + +Parameters: + +TOR + Type Of Service. For future extensions. +CstmId + Customer Id. Used for multi tenant databases. +Subject + The code that uniquely identifies a user. +DestinationPrefix + The destination network number. For speed reasons we are not using here the below described destinations. We are trading memory space for speed. +ActivationPeriods + A list of one ore more price descriptive periods. These periods must be contiguous and non overlapping. +ActivationTime + The time when current period becomes active. +Intervals + A list of price intervals intervals +Month + The month for this interval. Zero value means all months. +MonthDay + The day of the month for this interval. Zero value means all month days. +WeekDays + A list with the days of the week for this interval. An empty list means all week days. +StartTime, EndTime + The start and end hours in a day for this interval. Zero value means from/to start/end of the day. +Ponder + Used to set the priority of the interval in relation with other applicable intervals. +ConnectFee + The connection price for this interval. +Price + The unit price for this interval. +BillingUnit + The billing unit for this interval (in seconds). Value can be below one up to nanoseconds. **Destinations** :: @@ -144,6 +177,14 @@ The above snippet describes prices for subject "rif" and destination "0257". The {"Id":"mobil", "Prefixes":["0723","0740"]}, {"Id":"radu", "Prefixes":["0723045326"]} +Destinations are list of prefixes that together define a destination. These destinations are used for definition of minute buckets. + +Parameters: + +Id + The id of this destination. Can be anything (letters and/or numbers). +Prefixes + List with destination's prefixes. A prefix can appear in more than one destination. **Tariff plans** :: diff --git a/timespans/activationperiod.go b/timespans/activationperiod.go index 5ff23fd77..990d79a01 100644 --- a/timespans/activationperiod.go +++ b/timespans/activationperiod.go @@ -30,7 +30,6 @@ The struture that is saved to storage. type ActivationPeriod struct { ActivationTime time.Time Intervals []*Interval - Moaca string } /*