mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 21:59:53 +05:00
Improved stats
This commit is contained in:
committed by
Dan Christian Bogos
parent
5537e8993d
commit
d3580092ed
@@ -318,9 +318,8 @@ func (sq *StatQueue) addStatEvent(ctx *context.Context, tnt, evID string, filter
|
||||
continue
|
||||
}
|
||||
// in case of # metrics type
|
||||
metricSplit := strings.Split(metricCfg.MetricID, utils.HashtagSep)
|
||||
if err = sq.SQMetrics[metricSplit[0]].AddEvent(evID, dDP); err != nil {
|
||||
utils.Logger.Warning(fmt.Sprintf("<StatQueue>: metric: %s, add eventID: %s, error: %s", metricSplit[0],
|
||||
if err = sq.SQMetrics[metricCfg.MetricID].AddEvent(evID, dDP); err != nil {
|
||||
utils.Logger.Warning(fmt.Sprintf("<StatQueue>: metric: %s, add eventID: %s, error: %s", metricCfg.MetricID,
|
||||
evID, err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ func prepareStatsData(t *testing.T, dm *DataManager) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
statQueue.SQMetrics[utils.MetaSum] = statSum
|
||||
statQueue.SQMetrics["*sum#~*req.Usage"] = statSum
|
||||
dm.SetStatQueue(context.Background(), statQueue)
|
||||
}
|
||||
//Test each statQueueProfile from cache
|
||||
@@ -476,7 +476,7 @@ func TestStatQueuesV1ProcessEvent(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
sq := &StatQueue{Tenant: "cgrates.org", ID: "StatQueueProfile3", sqPrfl: sqPrf, SQMetrics: map[string]StatMetric{utils.MetaSum: statSum}}
|
||||
sq := &StatQueue{Tenant: "cgrates.org", ID: "StatQueueProfile3", sqPrfl: sqPrf, SQMetrics: map[string]StatMetric{"*sum#~*req.Usage": statSum}}
|
||||
if err := dmSTS.SetStatQueueProfile(context.TODO(), sqPrf, true); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -134,7 +134,6 @@ func testCDRsLoadTariffPlanFromFolder(t *testing.T) {
|
||||
} else if rpl != utils.OK {
|
||||
t.Error("Unexpected reply returned:", rpl)
|
||||
}
|
||||
time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Give time for scheduler to execute topups
|
||||
var resp string
|
||||
if err := cdrsRpc.Call(context.Background(), utils.AdminSv1RemoveChargerProfile,
|
||||
&utils.TenantID{Tenant: "cgrates.org", ID: "SupplierCharges"}, &resp); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user