@@ -45,43 +45,43 @@ public GraphQLReportDataProvider(Supplier<GraphQLCoverage> coverageSupplier) {
4545
4646 @ Override
4747 public Stream <ReportCustomData > provide (WebTauTestList tests ) {
48- List <? extends Map <String , ?>> nonCoveredOperations = coverageSupplier .get ().nonCoveredOperations ()
49- .map (GraphQLOperation ::toMap )
48+ List <? extends Map <String , ?>> nonCoveredQueries = coverageSupplier .get ().nonCoveredQueries ()
49+ .map (GraphQLQuery ::toMap )
5050 .collect (Collectors .toList ());
5151
52- List <? extends Map <String , ?>> coveredOperations = coverageSupplier .get ().coveredOperations ()
53- .map (GraphQLOperation ::toMap )
52+ List <? extends Map <String , ?>> coveredQueries = coverageSupplier .get ().coveredQueries ()
53+ .map (GraphQLQuery ::toMap )
5454 .collect (Collectors .toList ());
5555
56- List <? extends Map <String , ?>> timingByOperation = computeTiming ();
56+ List <? extends Map <String , ?>> timingByQuery = computeTiming ();
5757
5858 Map <String , ?> coverageSummary = computeCoverageSummary ();
5959
6060 return Stream .of (
61- new ReportCustomData ("graphQLSkippedOperations " , nonCoveredOperations ),
62- new ReportCustomData ("graphQLCoveredOperations " , coveredOperations ),
63- new ReportCustomData ("graphQLOperationTimeStatistics " , timingByOperation ),
61+ new ReportCustomData ("graphQLSkippedQueries " , nonCoveredQueries ),
62+ new ReportCustomData ("graphQLCoveredQueries " , coveredQueries ),
63+ new ReportCustomData ("graphQLQueryTimeStatistics " , timingByQuery ),
6464 new ReportCustomData ("graphQLCoverageSummary" , coverageSummary ));
6565 }
6666
6767 private List <? extends Map <String , ?>> computeTiming () {
6868 return coverageSupplier .get ().actualCalls ().map (GraphQLReportDataProvider ::computeTiming ).collect (Collectors .toList ());
6969 }
7070
71- private static Map <String , ?> computeTiming (Map .Entry <GraphQLOperation , Set <GraphQLCoveredOperations .Call >> entry ) {
71+ private static Map <String , ?> computeTiming (Map .Entry <GraphQLQuery , Set <GraphQLCoveredQueries .Call >> entry ) {
7272 Map <String , Object > data = new LinkedHashMap <>();
7373 data .put ("name" , entry .getKey ().getName ());
7474 data .put ("type" , entry .getKey ().getType ().name ().toLowerCase ());
7575
7676 Map <String , Object > statistics = new LinkedHashMap <>();
7777 data .put ("statistics" , statistics );
7878
79- LongSummaryStatistics summaryStatistics = entry .getValue ().stream ().collect (Collectors .summarizingLong (GraphQLCoveredOperations .Call ::getElapsedTime ));
79+ LongSummaryStatistics summaryStatistics = entry .getValue ().stream ().collect (Collectors .summarizingLong (GraphQLCoveredQueries .Call ::getElapsedTime ));
8080 statistics .put ("mean" , summaryStatistics .getAverage ());
8181 statistics .put ("min" , summaryStatistics .getMin ());
8282 statistics .put ("max" , summaryStatistics .getMax ());
8383
84- double [] times = entry .getValue ().stream ().map (GraphQLCoveredOperations .Call ::getElapsedTime ).mapToDouble (Long ::doubleValue ).sorted ().toArray ();
84+ double [] times = entry .getValue ().stream ().map (GraphQLCoveredQueries .Call ::getElapsedTime ).mapToDouble (Long ::doubleValue ).sorted ().toArray ();
8585 Percentile percentile = new Percentile ();
8686 statistics .put ("p95" , percentile .evaluate (times , 95 ));
8787 statistics .put ("p99" , percentile .evaluate (times , 99 ));
@@ -91,29 +91,29 @@ public Stream<ReportCustomData> provide(WebTauTestList tests) {
9191
9292 private Map <String , ?> computeCoverageSummary () {
9393 Map <String , Object > summary = new HashMap <>();
94- Map <GraphQLOperationType , List <GraphQLOperation >> declaredOpByType = coverageSupplier .get ().declaredOperations ().collect (Collectors .groupingBy (GraphQLOperation ::getType ));
95- Map <GraphQLOperationType , List <GraphQLOperation >> coveredOpsByType = coverageSupplier .get ().coveredOperations ().collect (Collectors .groupingBy (GraphQLOperation ::getType ));
94+ Map <GraphQLQueryType , List <GraphQLQuery >> declaredQueriesByType = coverageSupplier .get ().declaredQueries ().collect (Collectors .groupingBy (GraphQLQuery ::getType ));
95+ Map <GraphQLQueryType , List <GraphQLQuery >> coveredQueriesByType = coverageSupplier .get ().coveredQueries ().collect (Collectors .groupingBy (GraphQLQuery ::getType ));
9696
9797 Map <String , Object > summaryByType = new HashMap <>();
98- declaredOpByType .forEach ((type , ops ) -> {
99- double coveredOperations = coveredOpsByType .getOrDefault (type , Collections .emptyList ()).size ();
100- double coverage = coveredOperations / ops .size ();
98+ declaredQueriesByType .forEach ((type , queries ) -> {
99+ double coveredQueries = coveredQueriesByType .getOrDefault (type , Collections .emptyList ()).size ();
100+ double coverage = coveredQueries / queries .size ();
101101
102102 Map <String , Object > summaryForType = new HashMap <>();
103- summaryForType .put ("declaredOperations " , ops .size ());
104- summaryForType .put ("coveredOperations " , coveredOperations );
103+ summaryForType .put ("declaredQueries " , queries .size ());
104+ summaryForType .put ("coveredQueries " , coveredQueries );
105105 summaryForType .put ("coverage" , coverage );
106106
107107 summaryByType .put (type .name ().toLowerCase (), summaryForType );
108108 });
109109 summary .put ("types" , summaryByType );
110110
111- double coveredOperations = coveredOpsByType .values ().stream ().mapToInt (List ::size ).sum ();
112- double declaredOperations = declaredOpByType .values ().stream ().mapToInt (List ::size ).sum ();
113- double totalCoverage = coveredOperations / declaredOperations ;
111+ double coveredQueries = coveredQueriesByType .values ().stream ().mapToInt (List ::size ).sum ();
112+ double declaredQueries = declaredQueriesByType .values ().stream ().mapToInt (List ::size ).sum ();
113+ double totalCoverage = coveredQueries / declaredQueries ;
114114
115- summary .put ("totalDeclaredOperations " , declaredOperations );
116- summary .put ("totalCoveredOperations " , coveredOperations );
115+ summary .put ("totalDeclaredQueries " , declaredQueries );
116+ summary .put ("totalCoveredQueries " , coveredQueries );
117117 summary .put ("coverage" , totalCoverage );
118118
119119 return summary ;
0 commit comments