删除代码

tags/yfai-mes-ext-v1.0
yxw 2 years ago
parent 7b7aa30deb
commit 58868d8d6e

@ -1,67 +0,0 @@
//package cn.estsh.i3plus.ext.mes.apiservice.config;
//import com.alibaba.fastjson.JSONObject;
//import lombok.Data;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.collections4.list.UnmodifiableList;
//import org.springframework.beans.BeansException;
//import org.springframework.beans.factory.config.BeanPostProcessor;
//import org.springframework.boot.CommandLineRunner;
//import org.springframework.stereotype.Component;
//
//import java.util.*;
//
//@Component
//@Slf4j
//public class BeanInitCastle implements BeanPostProcessor, CommandLineRunner {
// private final Map<String, Long> stats = new HashMap<>();
// private final List<Metric> metrics = new ArrayList<>();
//
// @Data
// public static class Metric {
// public Metric(String name, Integer value) {
// this.name = name;
// this.value = value;
// this.createDate = new Date();
// }
//
// private String name;
// private Integer value;
// private Date createDate;
// }
//
// @Override
// public void run(String... args) {
// /**
// * 启动完成之后打印时间
// */
// List<Metric> metrics = getMetrics();
// log.info(JSONObject.toJSONString(metrics));
// }
//
// public List<Metric> getMetrics() {
// metrics.sort((o1, o2) -> {
// try {
// return o2.getValue() - o1.getValue();
// } catch (Exception e) {
// return 0;
// }
// });
// log.info("metrics {}", JSONObject.toJSONString(metrics));
// return UnmodifiableList.unmodifiableList(metrics);
// }
//
// @Override
// public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
// stats.put(beanName, System.currentTimeMillis());
// return bean;
// }
//
// @Override
// public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
// Long start = stats.get(beanName);
// if (start != null) {
// metrics.add(new Metric(beanName, Math.toIntExact(System.currentTimeMillis() - start)));
// }
// return bean;
// }
//}
Loading…
Cancel
Save