Responsible for the monitoring of service call times and call time.
org.apache.dubbo.monitor.MonitorFactory
org.apache.dubbo.monitor.Monitor
<!-- Define the monitoring center -->
<dubbo:monitor address="xxx://ip:port" />
org.apache.dubbo.monitor.support.dubbo.DubboMonitorFactory
Maven project structure:
src
|-main
|-java
|-com
|-xxx
|-XxxMonitorFactoryjava (implement the MonitorFactory interface)
|-XxxMonitor.java (implement Monitor interface)
|-resources
|-META-INF
|-dubbo
|-org.apache.dubbo.monitor.MonitorFactory (plain text file, content: xxx=com.xxx.XxxMonitorFactory)
XxxMonitorFactory.java:
package com.xxx;
import org.apache.dubbo.monitor.MonitorFactory;
import org.apache.dubbo.monitor.Monitor;
import org.apache.dubbo.common.URL;
public class XxxMonitorFactory implements MonitorFactory {
public Monitor getMonitor(URL url) {
return new XxxMonitor(url);
}
}
XxxMonitor.java:
package com.xxx;
import org.apache.dubbo.monitor.Monitor;
public class XxxMonitor implements Monitor {
public void count(URL statistics) {
//...
}
}
META-INF/dubbo/org.apache.dubbo.monitor.MonitorFactory:
xxx=com.xxx.XxxMonitorFactory