This is an automated email from the ASF dual-hosted git repository. dpavlov pushed a commit to branch ignite-9542-new-run-stripe in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git
The following commit(s) were added to refs/heads/ignite-9542-new-run-stripe by this push: new 0e5a1f6 IGNITE-9542 More profiling info, scheduler thread names 0e5a1f6 is described below commit 0e5a1f67a1660a0d4f3b08b672d30e9871ce105a Author: Dmitriy Pavlov <dpav...@apache.org> AuthorDate: Wed Nov 28 15:10:49 2018 +0300 IGNITE-9542 More profiling info, scheduler thread names --- .../ignite/ci/di/scheduler/TcBotScheduler.java | 12 +++++++- .../ignited/runhist/RunHistCompactedDao.java | 32 ++-------------------- .../ci/teamcity/ignited/runhist/RunHistSync.java | 28 +------------------ 3 files changed, 15 insertions(+), 57 deletions(-) diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/TcBotScheduler.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/TcBotScheduler.java index e83e523..e1a56da 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/TcBotScheduler.java +++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/TcBotScheduler.java @@ -33,8 +33,18 @@ class TcBotScheduler implements IScheduler { /** Logger. */ private static final Logger logger = LoggerFactory.getLogger(TcBotScheduler.class); + private ThreadFactory threadFactory = Executors.defaultThreadFactory(); + + private final ThreadFactory threadFactory1 = r -> { + Thread thread = threadFactory.newThread(r); + + thread.setName("tc-scheduler-" + thread.getName()); + + return thread; + }; + /** Executor service. */ - private volatile ScheduledExecutorService executorSvc = Executors.newScheduledThreadPool(POOL_SIZE); + private volatile ScheduledExecutorService executorSvc = Executors.newScheduledThreadPool(POOL_SIZE, threadFactory1); /** Submit named task checker guard. */ private AtomicBoolean tickGuard = new AtomicBoolean(); diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistCompactedDao.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistCompactedDao.java index 3d4377b..a4fa0c7 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistCompactedDao.java +++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistCompactedDao.java @@ -80,34 +80,6 @@ public class RunHistCompactedDao { return testHistCache.get(new RunHistKey(srvIdMaskHigh, testName, branchId)); } - @AutoProfiling - public Boolean addInvocation(final int srvId, - final TestCompacted t, - final int buildId, - final int branchName, - Invocation inv) { - RunHistKey histKey = new RunHistKey(srvId, t.testName(), branchName); - - return testHistCache.invoke(histKey, (entry, parms) -> { - boolean newValue = false; - RunHistCompacted hist = entry.getValue(); - - if (hist == null) - hist = new RunHistCompacted(entry.getKey()); - - newValue= hist.addTestRun( - (Integer) parms[0], - (Invocation) parms[1]); - - entry.setValue(hist); - - return newValue; - }, - buildId, inv - ); - - } - /** * @param srvId Server id mask high. * @param buildId Build id. @@ -116,15 +88,17 @@ public class RunHistCompactedDao { return (long)buildId | srvId << 32; } - + @AutoProfiling public boolean buildWasProcessed(int srvId, int buildId) { return buildStartTime.containsKey(buildIdToCacheKey(srvId, buildId)); } + @AutoProfiling public boolean setBuildProcessed(int srvId, int buildId, long ts) { return buildStartTime.putIfAbsent(buildIdToCacheKey(srvId, buildId), ts); } + @AutoProfiling public Integer addInvocations(RunHistKey histKey, List<Invocation> list) { if(list.isEmpty()) return 0; diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistSync.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistSync.java index fe72d48..d14a8ed 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistSync.java +++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistSync.java @@ -130,7 +130,7 @@ public class RunHistSync { } @AutoProfiling - @NotNull private String saveInvocationsMap(Map<RunHistKey, List<Invocation>> saveThisRun) { + @NotNull protected String saveInvocationsMap(Map<RunHistKey, List<Invocation>> saveThisRun) { Set<Integer> confirmedNewBuild = new HashSet<>(); Set<Integer> confirmedDuplicate = new HashSet<>(); AtomicInteger invocations = new AtomicInteger(); @@ -190,32 +190,6 @@ public class RunHistSync { duplicates.addAndGet(invocationList.size() - cntAdded); } - @AutoProfiling - protected void saveInvocationsForBuild(int srvMask, - @Nullable AtomicInteger invocations, - @Nullable AtomicInteger duplicates, - FatBuildCompacted build) { - if (!histDao.setBuildProcessed(srvMask, build.id(), build.getStartDateTs())) { - if (duplicates != null) - duplicates.incrementAndGet(); - - return; - } - - build.getAllTests().forEach(t -> { - Invocation inv = t.toInvocation(compactor, build); - - final Boolean res = histDao.addInvocation(srvMask, t, build.id(), build.branchName(), inv); - - if (Boolean.FALSE.equals(res)) { - if (duplicates != null) - duplicates.incrementAndGet(); - } - else if (invocations != null) - invocations.incrementAndGet(); - }); - } - public void invokeLaterFindMissingHistory(String srvName) { scheduler.sheduleNamed(taskName("findMissingHistFromBuildRef", srvName), () -> findMissingHistFromBuildRef(srvName), 360, TimeUnit.MINUTES);