Skip to content

Commit

Permalink
Merge pull request #722 from salesforce/rvarati-W-13995941-fixAggrega…
Browse files Browse the repository at this point in the history
…tionMetricTest

@W-13995941: Fix the aggregation metric test
  • Loading branch information
rvarati12 authored Oct 4, 2023
2 parents b9c2105 + 012f51e commit ed609e0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public void setUp()
ecom_agLatencyRule = MetricAggregationRule.parseDefinition( "<pod>.ecom_ag_latency.infrastructure.metrics.blade.reachability (60) = latency <pod>.infrastructure.metrics.blade.*.*.reachability" );

ecom_agRequestRule = MetricAggregationRule.parseDefinition( "<pod>.ecom_ag.<realm>.<tenant>.requests.active-requests.count (60) c = sum <pod>.ecom.<realm>.<tenant>.*.*.requests.*.active-requests.count" );
ecom_agRequest_new_Rule = MetricAggregationRule.parseDefinition( "<pod>.ecom_ag.<realm>.<tenant>.requests.active-requests.count (60) c = sum <pod>.ecom.<realm>.<tenant>.*.*.requests.((?!on-request)(*)).active-requests.count" );
ecom_agRequest_new_Rule = MetricAggregationRule.parseDefinition( "<pod>.ecom_ag.<realm>.<tenant>.requests.active-requests.count (60) c = sum <pod>.ecom.<realm>.<tenant>.*.*.requests.((?!onrequest)(*)).active-requests.count" );
}

@Test
public void shouldApply_ecom_ag_request_rule()
{
String name1 = "pod1.ecom.aaba.aaba_prd.blade5-4.aaba_prd.requests.on-request.active-requests.count";
String name1 = "pod1.ecom.aaba.aaba_prd.blade5-4.aaba_prd.requests.onrequest.active-requests.count";
String name2 = "pod1.ecom.aaba.aaba_prd.blade5-4.aaba_prd.requests.pipeline.active-requests.count";
Result expected1 = new Result("pod1.ecom_ag.aaba.aaba_prd.requests.active-requests.count", SUM, false );
Result expected2 = new Result("pod1.ecom_ag.aaba.aaba_prd.requests.active-requests.count", SUM, false );
Expand All @@ -50,9 +50,9 @@ public void shouldApply_ecom_ag_request_rule()
@Test
public void shouldApply_ecom_ag_request_new_rule()
{
String name1 = "pod1.ecom.aaba.aaba_prd.blade5-4.aaba_prd.requests.on-request.active-requests.count";
String name1 = "pod1.ecom.aaba.aaba_prd.blade5-4.aaba_prd.requests.onrequest.active-requests.count";
String name2 = "pod1.ecom.aaba.aaba_prd.blade5-4.aaba_prd.requests.pipeline.active-requests.count";
Result expected1 = new Result(null, null, false ); // Should drop on-request
Result expected1 = new Result(null, null, false ); // Should drop onrequest
Result expected2 = new Result("pod1.ecom_ag.aaba.aaba_prd.requests.active-requests.count", SUM, false );
assertThat( ecom_agRequest_new_Rule.apply( name1 ), equalTo( expected1 ) );
assertThat( ecom_agRequest_new_Rule.apply( name2 ), equalTo( expected2 ) );
Expand Down

0 comments on commit ed609e0

Please sign in to comment.