You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/01/22 13:59:58 UTC

[ignite-teamcity-bot] branch master updated: IGNITE-10989: Deprecates URLs monitoring was removed.

This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
     new 0055a6c  IGNITE-10989: Deprecates URLs monitoring was removed.
0055a6c is described below

commit 0055a6c9834e9d5b9a9ed9c5438bfaca41e61dbc
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Tue Jan 22 16:59:53 2019 +0300

    IGNITE-10989: Deprecates URLs monitoring was removed.
---
 .../ignite/ci/tcbot/TcBotSystemProperties.java     |  6 ++--
 .../ignite/ci/teamcity/pure/TeamcityRecorder.java  | 18 ----------
 .../org/apache/ignite/ci/web/model/Version.java    |  6 +---
 .../ci/web/rest/monitoring/MonitoringService.java  | 38 ++++++----------------
 .../ignite/ci/web/rest/monitoring/UrlUsed.java     | 24 --------------
 .../src/main/webapp/monitoring.html                | 31 ------------------
 6 files changed, 15 insertions(+), 108 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotSystemProperties.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotSystemProperties.java
index 584862e..1e4b45c 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotSystemProperties.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotSystemProperties.java
@@ -17,9 +17,11 @@
 
 package org.apache.ignite.ci.tcbot;
 
+/**
+ * Apache Ignite Teamcity Bot properties.
+ */
 public class TcBotSystemProperties {
     public static final String DEV_MODE = "DEV_MODE";
-    @Deprecated
-    public static final String TEAMCITY_BOT_RECORDER_URLS = "teamcity.bot.recorder.urls";
+
     public static final String TEAMCITY_BOT_RECORDER = "teamcity.bot.recorder";
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/pure/TeamcityRecorder.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/pure/TeamcityRecorder.java
index 6dc6174..4bd0b81 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/pure/TeamcityRecorder.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/pure/TeamcityRecorder.java
@@ -30,9 +30,6 @@ import org.apache.ignite.ci.tcbot.TcBotSystemProperties;
  *
  */
 public class TeamcityRecorder {
-    /** Urls. */
-    private ConcurrentLinkedQueue<String> urls = new ConcurrentLinkedQueue<>();
-
     /** Lock. */
     private ReentrantLock lock = new ReentrantLock();
 
@@ -44,13 +41,6 @@ public class TeamcityRecorder {
      * @param url Url.
      */
     public InputStream onGet(InputStream inputStream, String url) throws IOException {
-        if (Boolean.valueOf(System.getProperty(TcBotSystemProperties.TEAMCITY_BOT_RECORDER_URLS))) {
-            urls.add(url);
-
-            if (urls.size() > 100)
-                urls.remove();
-        }
-
         if (Boolean.valueOf(System.getProperty(TcBotSystemProperties.TEAMCITY_BOT_RECORDER))) {
             boolean success = false;
 
@@ -80,14 +70,6 @@ public class TeamcityRecorder {
     /**
      *
      */
-    @Deprecated
-    public List<String> getUrls() {
-        return new ArrayList<>(urls);
-    }
-
-    /**
-     *
-     */
     public void stop() throws IOException {
         if (file != null)
             file.close();
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/Version.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/Version.java
index 4994b27..1d4090e 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/Version.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/Version.java
@@ -40,11 +40,7 @@ package org.apache.ignite.ci.web.model;
     public String ignVerFull;
 
     /** TC Bot GitHub Mirror. */
-    @Deprecated
-    public String srcWebUrl = GITHUB_REF;
-
-    /** TC Bot GitHub Mirror. */
-    public String gitHubMirror = srcWebUrl;
+    public String gitHubMirror = GITHUB_REF;
 
     /** TC Bot Source */
     public String apacheGitUrl = "https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git";
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/monitoring/MonitoringService.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/monitoring/MonitoringService.java
index 012874d..576a38d 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/monitoring/MonitoringService.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/monitoring/MonitoringService.java
@@ -23,7 +23,6 @@ import org.apache.ignite.cache.CacheMetrics;
 import org.apache.ignite.cache.affinity.Affinity;
 import org.apache.ignite.ci.di.AutoProfilingInterceptor;
 import org.apache.ignite.ci.di.MonitoredTaskInterceptor;
-import org.apache.ignite.ci.teamcity.pure.TeamcityRecorder;
 import org.apache.ignite.ci.web.CtxListener;
 
 import javax.annotation.security.PermitAll;
@@ -41,6 +40,7 @@ import org.apache.ignite.ci.web.model.SimpleResult;
 @Path("monitoring")
 @Produces(MediaType.APPLICATION_JSON)
 public class MonitoringService {
+    /** Context. */
     @Context
     private ServletContext ctx;
 
@@ -53,13 +53,13 @@ public class MonitoringService {
         final Collection<MonitoredTaskInterceptor.Invocation> list = instance.getList();
 
         return list.stream().map(invocation -> {
-            final TaskResult result = new TaskResult();
-            result.name = invocation.name();
-            result.start = invocation.start();
-            result.end = invocation.end();
-            result.result = invocation.result();
-            result.count = invocation.count();
-            return result;
+            final TaskResult res = new TaskResult();
+            res.name = invocation.name();
+            res.start = invocation.start();
+            res.end = invocation.end();
+            res.result = invocation.result();
+            res.count = invocation.count();
+            return res;
         }).collect(Collectors.toList());
     }
 
@@ -117,10 +117,9 @@ public class MonitoringService {
                 continue;
             CacheMetrics metrics = cache.metrics();
 
-
             int size = cache.size();
-             float averageGetTime = metrics.getAverageGetTime();
-             float averagePutTime = metrics.getAveragePutTime();
+            float averageGetTime = metrics.getAverageGetTime();
+            float averagePutTime = metrics.getAveragePutTime();
 
             //System.out.println(next + ": " + size + " get " + averageGetTime + " put " + averagePutTime);
 
@@ -130,21 +129,4 @@ public class MonitoringService {
         }
         return res;
     }
-
-
-    @Deprecated
-    @GET
-    @PermitAll
-    @Path("urlsUsed")
-    public List<UrlUsed> getUrlsUsed() {
-        final TeamcityRecorder recorder = CtxListener.getInjector(ctx).getInstance(TeamcityRecorder.class);
-
-        final List<String> urls = recorder.getUrls();
-
-        return urls.stream().map(s -> {
-            final UrlUsed urlRequested = new UrlUsed();
-            urlRequested.url = s;
-            return urlRequested;
-        }).collect(Collectors.toList());
-    }
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/monitoring/UrlUsed.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/monitoring/UrlUsed.java
deleted file mode 100644
index aa859e6..0000000
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/monitoring/UrlUsed.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ignite.ci.web.rest.monitoring;
-
-
-@SuppressWarnings("WeakerAccess")
-@Deprecated
-public class UrlUsed {
-    public String url;
-}
diff --git a/ignite-tc-helper-web/src/main/webapp/monitoring.html b/ignite-tc-helper-web/src/main/webapp/monitoring.html
index e7258b3..8e708a7 100644
--- a/ignite-tc-helper-web/src/main/webapp/monitoring.html
+++ b/ignite-tc-helper-web/src/main/webapp/monitoring.html
@@ -65,16 +65,6 @@
             },
             error: showErrInLoadStatus
         });
-
-        $.ajax({
-            url: "rest/monitoring/urlsUsed",
-            success: function(result) {
-                $("#loadStatus").html("");
-
-                showUrlsUsed(result);
-            },
-            error: showErrInLoadStatus
-        });
     }
 
     /**
@@ -145,24 +135,6 @@
         $("#caches").html(res);
     }
 
-    /**
-     * @param result org.apache.ignite.ci.web.rest.monitoring.UrlUsed
-     */
-    function showUrlsUsed(result) {
-        var res = "<table class='stat'>" ;
-        res += "<tr>";
-        res += "<th>URL</th>";
-        res += "</tr>";
-        for (var i = 0; i < result.length; i++) {
-            var inv = result[i];
-            res += "<tr>";
-            res += "<td>" + inv.url + "</td>";
-            res += "</tr>";
-        }
-        res += "</table>";
-        $("#urlUsed").html(res);
-    }
-
     function resetProfiling() {
         $.ajax({
             url: "rest/monitoring/resetProfiling",
@@ -189,9 +161,6 @@ Tasks Monitoring Data:
 <b>Ignite Caches Data:</b>
 <div id="caches" style="font-family: monospace"></div>
 
-<hr>
-<b>Services URLs used:</b>
-<div id="urlUsed"></div>
 <br>
 <div id="loadStatus"></div>
 <div id="version"></div>