added compressing for metrics on trends

This commit is contained in:
gezimbll
2024-10-14 08:39:11 +02:00
committed by Dan Christian Bogos
parent 69f4f08770
commit 3dccb44511
10 changed files with 106 additions and 37 deletions

View File

@@ -179,13 +179,13 @@ func testScheduledTrends(t *testing.T) {
},
{
TrendID: "TREND_2",
Next: time.Now().Add(3 * time.Second),
Next: time.Now().Add(4 * time.Second),
},
}
if err := trendAuQRpc.Call(context.Background(), utils.TrendSv1GetScheduledTrends, &utils.ArgScheduledTrends{TenantIDWithAPIOpts: utils.TenantIDWithAPIOpts{TenantID: &utils.TenantID{Tenant: "cgrates.org"}}, TrendIDPrefix: []string{"TREND"}}, &schedTrends); err != nil {
t.Error(err)
} else if diff := cmp.Diff(schedTrends, expTrends, cmpopts.EquateApproxTime(3*time.Second), cmpopts.IgnoreFields(utils.ScheduledTrend{}, "Prev")); diff != utils.EmptyString {
} else if diff := cmp.Diff(schedTrends, expTrends, cmpopts.EquateApproxTime(4*time.Second), cmpopts.IgnoreFields(utils.ScheduledTrend{}, "Prev")); diff != utils.EmptyString {
t.Errorf("unexpected scheduled trends (-want +got)\n%s", diff)
}