[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670807#comment-16670807
 ] 

ASF GitHub Bot commented on IGNITE-9849:
----------------------------------------

dspavlov commented on a change in pull request #57: IGNITE-9849 Refactor Master 
trends
URL: https://github.com/apache/ignite-teamcity-bot/pull/57#discussion_r229879687
 
 

 ##########
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/BuildStatisticsSummary.java
 ##########
 @@ -91,122 +96,122 @@ public BuildStatisticsSummary(Integer buildId){
     }
 
     /** Initialize build statistics. */
-    public void initialize(@Nonnull final ITeamcity teamcity) {
-        Build build = teamcity.getBuild(buildId);
+    public void initialize(@Nonnull final IStringCompactor compactor, @Nonnull 
final ITeamcityIgnited ignitedTeamcity) {
+        if (strIds.isEmpty()) {
+            strIds.put(STATUS_SUCCESS, compactor.getStringId(STATUS_SUCCESS));
+            strIds.put(TC_EXIT_CODE, compactor.getStringId(TC_EXIT_CODE));
+            strIds.put(TC_OOME, compactor.getStringId(TC_OOME));
+            strIds.put(TC_JVM_CRASH, compactor.getStringId(TC_JVM_CRASH));
+            strIds.put(TC_EXECUTION_TIMEOUT, 
compactor.getStringId(TC_EXECUTION_TIMEOUT));
+        }
+
+        FatBuildCompacted build = ignitedTeamcity.getFatBuild(buildId);
 
         isFakeStub = build.isFakeStub();
 
         if (isFakeStub)
             return;
 
         DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy'T'HH:mm:ss");
-        dateFormat.format(build.getFinishDate());
+
         startDate = dateFormat.format(build.getStartDate());
 
-        testOccurrences = build.testOccurrences;
+        int[] arr = new int[4];
 
-        duration = (build.getFinishDate().getTime() - 
build.getStartDate().getTime()) / 1000;
+        build.getAllTests().forEach(t -> {
+                if (t.getIgnoredFlag())
+                    arr[0]++;
+                else if (t.getMutedFlag())
+                    arr[1]++;
+                else if (t.status() != strIds.get(STATUS_SUCCESS))
+                    arr[2]++;
 
-        List<BuildRef> snapshotDependencies = 
getSnapshotDependencies(teamcity, build);
+            arr[3]++;
+        });
 
-        List<BuildRef> snapshotDependenciesWithProblems = 
getBuildsWithProblems(snapshotDependencies);
+        testOccurrences.ignored = arr[0];
+        testOccurrences.muted = arr[1];
+        testOccurrences.failed = arr[2];
+        testOccurrences.count = arr[3];
+        testOccurrences.passed = testOccurrences.count - 
testOccurrences.failed - testOccurrences.ignored -
+        testOccurrences.muted;
 
-        problemOccurrenceList = getProblems(teamcity, 
snapshotDependenciesWithProblems);
+        duration = (build.getFinishDate().getTime() - 
build.getStartDate().getTime()) / 1000;
 
 Review comment:
   Just as an option: we can take build duration from the build statistics, it 
is always provided with new FatBuild

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Remove invalid builds from the selection
> ----------------------------------------
>
>                 Key: IGNITE-9849
>                 URL: https://issues.apache.org/jira/browse/IGNITE-9849
>             Project: Ignite
>          Issue Type: Sub-task
>            Reporter: Nikolai Kulagin
>            Assignee: Nikolai Kulagin
>            Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to