mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 02:26:26 +05:00
Threshold structure
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
#Tenant[0],Id[1],FilterType[2],FilterFieldName[3],FilterFieldValues[4],ActivationInterval[5],QueueLength[6],TTL[7],Metrics[8],Blocker[9],Stored[10],Weight[11],Thresholds[12]
|
||||
#Tenant[0],Id[1],FilterType[2],FilterFieldName[3],FilterFieldValues[4],ActivationInterval[5],QueueLength[6],TTL[7],Metrics[8],Blocker[9],Stored[10],Weight[11],MinItems[12],Thresholds[13]
|
||||
cgrates.org,STATS_1,*string,Account,1001;1002,2014-07-29T15:00:00Z,100,1s,*asr;*acc;*tcc;*acd;*tcd,true,true,20,THRESH1;THRESH2
|
||||
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#Tenant[0],Id[1],FilterType[2],FilterFieldName[3],FilterFieldValues[4],ActivationInterval[5],MinItems[6],Recurrent[7],MinSleep[8],Blocker[9],Stored[10],Weight[11],ActionIDs[12]
|
||||
#Tenant[0],Id[1],FilterType[2],FilterFieldName[3],FilterFieldValues[4],ActivationInterval[5],Recurrent[6],MinSleep[7],Blocker[8],Stored[9],Weight[10],ActionIDs[11]
|
||||
Threshold1,*string,Account,1001;1002,2014-07-29T15:00:00Z,,1.2,10,true,1s,true,true,10,THRESH1;THRESH2
|
||||
|
@@ -41,3 +41,22 @@ type ThresholdProfile struct {
|
||||
func (tp *ThresholdProfile) TenantID() string {
|
||||
return utils.ConcatenatedKey(tp.Tenant, tp.ID)
|
||||
}
|
||||
|
||||
// ThresholdEvent is an event processed by ThresholdService
|
||||
type ThresholdEvent struct {
|
||||
Tenant string
|
||||
ID string
|
||||
Fields map[string]interface{}
|
||||
}
|
||||
|
||||
// Threshold is the unit matched by filters
|
||||
// It's WakeupTime is stored on demand
|
||||
type Threshold struct {
|
||||
Tenant string
|
||||
ID string
|
||||
LastExecuted time.Time
|
||||
WakeupTime time.Time // prevent threshold to run too early
|
||||
|
||||
tPrfl *ThresholdProfile
|
||||
dirty *bool // needs save
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user