|
|
@ -1,7 +1,5 @@ |
|
|
|
package com.fr.design.carton.latency; |
|
|
|
package com.fr.design.carton.latency; |
|
|
|
|
|
|
|
|
|
|
|
import com.fanruan.third.v2.org.ehcache.impl.internal.concurrent.ConcurrentHashMap; |
|
|
|
|
|
|
|
import com.fr.concurrent.FineExecutors; |
|
|
|
|
|
|
|
import com.fr.concurrent.NamedThreadFactory; |
|
|
|
import com.fr.concurrent.NamedThreadFactory; |
|
|
|
import com.fr.config.MarketConfig; |
|
|
|
import com.fr.config.MarketConfig; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
@ -19,6 +17,7 @@ import com.fr.workspace.WorkspaceEvent; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
import java.util.concurrent.Executors; |
|
|
|
import java.util.concurrent.Executors; |
|
|
|
import java.util.concurrent.ScheduledExecutorService; |
|
|
|
import java.util.concurrent.ScheduledExecutorService; |
|
|
@ -72,8 +71,7 @@ public class DesignerLatencyMetric { |
|
|
|
// 初始化容器
|
|
|
|
// 初始化容器
|
|
|
|
initializeContainer(); |
|
|
|
initializeContainer(); |
|
|
|
// 启动异步性能记录线程池
|
|
|
|
// 启动异步性能记录线程池
|
|
|
|
executorService = FineExecutors.newCachedThreadPool( |
|
|
|
executorService = Executors.newFixedThreadPool(8); |
|
|
|
new NamedThreadFactory(DesignerLatencyMetric.class)); |
|
|
|
|
|
|
|
// 启动定时埋点
|
|
|
|
// 启动定时埋点
|
|
|
|
this.scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("LatencyMetricWorker")); |
|
|
|
this.scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("LatencyMetricWorker")); |
|
|
|
this.scheduler.scheduleWithFixedDelay(this::collectAndSubmit, 60, 60, TimeUnit.SECONDS); |
|
|
|
this.scheduler.scheduleWithFixedDelay(this::collectAndSubmit, 60, 60, TimeUnit.SECONDS); |
|
|
|