updated trendprofile model structure

This commit is contained in:
gezimblliku
2024-09-18 11:40:42 +02:00
committed by Dan Christian Bogos
parent fb9e69e812
commit bfba6c6f74
10 changed files with 12 additions and 12 deletions

View File

@@ -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 = `

View File

@@ -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

View File

@@ -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) {

View File

@@ -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,

View File

@@ -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:".*"`