|
@@ -30,7 +30,7 @@ public class ThresholdModelContainer {
|
|
|
private double position;
|
|
|
|
|
|
public static Map<String,ThresholdPredictModel> modelMap=new HashMap<>();
|
|
|
- public static Map<Integer,MergingDigest> mergingDigestMap=new HashMap<>();
|
|
|
+// public static Map<Integer,MergingDigest> mergingDigestMap=new HashMap<>();
|
|
|
|
|
|
private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
|
|
|
@PostConstruct
|
|
@@ -40,21 +40,21 @@ public class ThresholdModelContainer {
|
|
|
modelMap.put(model.getName(), model);
|
|
|
});
|
|
|
//只关注重点app
|
|
|
- mergingDigestMap.put(0, new MergingDigest(10000));
|
|
|
- mergingDigestMap.put(3, new MergingDigest(10000));
|
|
|
- mergingDigestMap.put(4, new MergingDigest(10000));
|
|
|
- mergingDigestMap.put(5, new MergingDigest(10000));
|
|
|
- mergingDigestMap.put(21, new MergingDigest(10000));
|
|
|
- final Runnable task = new Runnable() {
|
|
|
- public void run() {
|
|
|
- try {
|
|
|
- printDigestThreshold();
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- scheduler.scheduleAtFixedRate(task, 0, 1, TimeUnit.MINUTES); // 10分钟
|
|
|
+// mergingDigestMap.put(0, new MergingDigest(10000));
|
|
|
+// mergingDigestMap.put(3, new MergingDigest(10000));
|
|
|
+// mergingDigestMap.put(4, new MergingDigest(10000));
|
|
|
+// mergingDigestMap.put(5, new MergingDigest(10000));
|
|
|
+// mergingDigestMap.put(21, new MergingDigest(10000));
|
|
|
+// final Runnable task = new Runnable() {
|
|
|
+// public void run() {
|
|
|
+// try {
|
|
|
+// printDigestThreshold();
|
|
|
+// }catch (Exception e){
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+// }
|
|
|
+// };
|
|
|
+// scheduler.scheduleAtFixedRate(task, 0, 1, TimeUnit.MINUTES); // 10分钟
|
|
|
}
|
|
|
|
|
|
public static ThresholdPredictModel getThresholdPredictModel(String modelName){
|
|
@@ -65,25 +65,25 @@ public class ThresholdModelContainer {
|
|
|
return modelMap.get("basic");
|
|
|
}
|
|
|
|
|
|
- public static void mergingDigestAddScore(Integer appType,Double score){
|
|
|
- mergingDigestMap.getOrDefault(appType,new MergingDigest(1)).add(score);
|
|
|
- }
|
|
|
-
|
|
|
- public static double getThresholdByTDigest(Integer appType,Double sortPosition){
|
|
|
- return mergingDigestMap.getOrDefault(appType,new MergingDigest(1)).quantile(sortPosition);
|
|
|
- }
|
|
|
+// public static void mergingDigestAddScore(Integer appType,Double score){
|
|
|
+// mergingDigestMap.getOrDefault(appType,new MergingDigest(1)).add(score);
|
|
|
+// }
|
|
|
|
|
|
- public void printDigestThreshold(){
|
|
|
- try {
|
|
|
- for(Map.Entry<Integer,MergingDigest> entry:mergingDigestMap.entrySet()){
|
|
|
- log.info("svc=printDigestThreshold modelName=modelV2 appType={} mergingDigestThreshold={}"
|
|
|
- , entry.getKey(),entry.getValue().quantile(position));
|
|
|
- }
|
|
|
+// public static double getThresholdByTDigest(Integer appType,Double sortPosition){
|
|
|
+// return mergingDigestMap.getOrDefault(appType,new MergingDigest(1)).quantile(sortPosition);
|
|
|
+// }
|
|
|
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
+// public void printDigestThreshold(){
|
|
|
+// try {
|
|
|
+// for(Map.Entry<Integer,MergingDigest> entry:mergingDigestMap.entrySet()){
|
|
|
+// log.info("svc=printDigestThreshold modelName=modelV2 appType={} mergingDigestThreshold={}"
|
|
|
+// , entry.getKey(),entry.getValue().quantile(position));
|
|
|
+// }
|
|
|
+//
|
|
|
+// }catch (Exception e){
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
// public static void main(String[] args){
|