编程知识 cdmana.com

Comment on Java

And the interviewer will ask about notes .... Fortunately, I will

The interviewer tested me today Java annotation ...

public void send(String userName) {
  try {
    // qps  Report
    qps(params);
    long startTime = System.currentTimeMillis();

    //  Build context ( Simulate business code )
    ProcessContext processContext = new ProcessContext();
    UserModel userModel = new UserModel();
    userModel.setAge("22");
    userModel.setName(userName);
    //...

    // rt  Report
    long endTime = System.currentTimeMillis();
    rt(endTime - startTime);
  } catch (Exception e) {
    
    //  Error report
    error(params);
  }
}
@Around("@annotation(com.sanwai.service.openapi.monitor.Monitor)")
    public Object antispan(ProceedingJoinPoint pjp) throws Throwable {

        String functionName = pjp.getSignature().getName();
        Map<StringString> tags = new HashMap<>();

        logger.info(functionName);

        tags.put("functionName", functionName);
        tags.put("flag""done.........

版权声明
本文为[Program ape Owen]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201224140216691P.html

Tags comment java
Scroll to Top