File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed
framework/src/main/java/com/microsoft/applicationinsights/smoketest Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,5 @@ dependencies {
77 exclude(" org.springframework.boot" , " spring-boot-starter-tomcat" )
88 }
99 // want to test with one of the earliest version supported, and not managed version used in agent
10- implementation(enforcedPlatform(" com.azure:azure-sdk-bom:1.2.13" ))
11- implementation(" com.azure:azure-core" )
10+ implementation(" com.azure:azure-core:1.39.0" )
1211}
Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ private void clearOutAnyInitLogs() throws Exception {
288288 await ()
289289 .untilAsserted (
290290 () ->
291- assertThat (mockedIngestion .getLiveMetrics ().getSuccessfulRequestCount ( ))
291+ assertThat (mockedIngestion .getLiveMetrics ().getRequestCount ( "GET /" ))
292292 .isEqualTo (1 ));
293293
294294 System .out .println ("Clearing any RequestData from health check." );
Original file line number Diff line number Diff line change 1212import com .azure .monitor .opentelemetry .autoconfigure .implementation .quickpulse .swagger .models .Exception ;
1313import com .azure .monitor .opentelemetry .autoconfigure .implementation .quickpulse .swagger .models .MetricPoint ;
1414import com .azure .monitor .opentelemetry .autoconfigure .implementation .quickpulse .swagger .models .MonitoringDataPoint ;
15+ import com .azure .monitor .opentelemetry .autoconfigure .implementation .quickpulse .swagger .models .Request ;
1516import com .azure .monitor .opentelemetry .autoconfigure .implementation .quickpulse .swagger .models .Trace ;
1617import java .io .IOException ;
1718import java .util .ArrayList ;
@@ -36,14 +37,26 @@ public int getRequestCount() {
3637 return getMetricCount ("\\ ApplicationInsights\\ Requests/Sec" );
3738 }
3839
39- public int getSuccessfulRequestCount () {
40- return getMetricCount ("\\ ApplicationInsights\\ Requests Succeeded/Sec" );
41- }
42-
4340 public int getDependencyCount () {
4441 return getMetricCount ("\\ ApplicationInsights\\ Dependency Calls/Sec" );
4542 }
4643
44+ public int getRequestCount (String name ) {
45+ int count = 0 ;
46+ for (MonitoringDataPoint point : points ) {
47+ List <DocumentIngress > docs = point .getDocuments ();
48+ for (DocumentIngress doc : docs ) {
49+ if (doc .getDocumentType ().equals (DocumentType .REQUEST )) {
50+ Request request = (Request ) doc ;
51+ if (request .getName ().equals (name )) {
52+ count ++;
53+ }
54+ }
55+ }
56+ }
57+ return count ;
58+ }
59+
4760 public int getExceptionCount (String exceptionMessage ) {
4861 int count = 0 ;
4962 for (MonitoringDataPoint point : points ) {
You can’t perform that action at this time.
0 commit comments