mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
updated trendprofile model structure
This commit is contained in:
committed by
Dan Christian Bogos
parent
fb9e69e812
commit
bfba6c6f74
@@ -247,7 +247,7 @@ cgrates.org,TestStats2,,,,,2,*sum#~*req.Cost;*average#~*req.Cost,,true,true,20,
|
||||
cgrates.org,Ranking1,15m,Stats2;Stats3;Stats4,Metric1;Metric3,*asc,,THD1;THD2
|
||||
`
|
||||
TrendsCSVContent = `
|
||||
#Tenant[0],Id[1],Schedule[2],StatID[3],Metrics[4],QueueLength[5],TTL[6],MinItems[7],CorrelationType[8],Tolerance[9],Stored[10],ThresholdIDs[11]
|
||||
#Tenant[0],Id[1],Schedule[2],StatID[3],Metrics[4],TTL[5],QueueLength[6],MinItems[7],CorrelationType[8],Tolerance[9],Stored[10],ThresholdIDs[11]
|
||||
cgrates.org,TREND1,0 12 * * *,Stats2,*acc;*tcc,-1,-1,1,*average,2.1,true,TD1;TD2
|
||||
`
|
||||
ThresholdsCSVContent = `
|
||||
|
||||
@@ -33,8 +33,8 @@ type TrendProfile struct {
|
||||
Schedule string // Cron expression scheduling gathering of the metrics
|
||||
StatID string
|
||||
Metrics []string
|
||||
QueueLength int
|
||||
TTL time.Duration
|
||||
QueueLength int
|
||||
MinItems int // minimum number of items for building Trends
|
||||
CorrelationType string // *last, *average
|
||||
Tolerance float64 // allow this deviation margin for *constant trend
|
||||
|
||||
@@ -1644,7 +1644,7 @@ type TrendsMdls []*TrendsMdl
|
||||
|
||||
func (tps TrendsMdls) CSVHeader() (result []string) {
|
||||
return []string{"#" + utils.Tenant, utils.ID, utils.Schedule, utils.StatID,
|
||||
utils.Metrics, utils.QueueLength, utils.TTL, utils.MinItems, utils.CorrelationType, utils.Tolerance, utils.Stored, utils.ThresholdIDs}
|
||||
utils.Metrics, utils.TTL, utils.QueueLength, utils.MinItems, utils.CorrelationType, utils.Tolerance, utils.Stored, utils.ThresholdIDs}
|
||||
}
|
||||
|
||||
func (models TrendsMdls) AsTPTrends() (result []*utils.TPTrendsProfile) {
|
||||
|
||||
@@ -5975,8 +5975,8 @@ func TestTrendsMdlCSVHeader(t *testing.T) {
|
||||
utils.Schedule,
|
||||
utils.StatID,
|
||||
utils.Metrics,
|
||||
utils.QueueLength,
|
||||
utils.TTL,
|
||||
utils.QueueLength,
|
||||
utils.MinItems,
|
||||
utils.CorrelationType,
|
||||
utils.Tolerance,
|
||||
|
||||
@@ -309,8 +309,8 @@ type TrendsMdl struct {
|
||||
Schedule string `index:"2" re:".*"`
|
||||
StatID string `index:"3" re:".*"`
|
||||
Metrics string `index:"4" re:".*"`
|
||||
QueueLength int `index:"5" re:".*"`
|
||||
TTL string `index:"6" re:".*"`
|
||||
TTL string `index:"5" re:".*"`
|
||||
QueueLength int `index:"6" re:".*"`
|
||||
MinItems int `index:"7" re:".*"`
|
||||
CorrelationType string `index:"8" re:".*"`
|
||||
Tolerance float64 `index:"9" re:".*"`
|
||||
|
||||
Reference in New Issue
Block a user