Search in sources :

Example 1 with TpsMonitorPoint

use of com.alibaba.nacos.core.remote.control.TpsMonitorPoint in project nacos by alibaba.

the class RpcConfigChangeNotifier method registerTpsPoint.

@PostConstruct
private void registerTpsPoint() {
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(POINT_CONFIG_PUSH));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(POINT_CONFIG_PUSH_SUCCESS));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(POINT_CONFIG_PUSH_FAIL));
}
Also used : TpsMonitorPoint(com.alibaba.nacos.core.remote.control.TpsMonitorPoint) PostConstruct(javax.annotation.PostConstruct)

Example 2 with TpsMonitorPoint

use of com.alibaba.nacos.core.remote.control.TpsMonitorPoint in project nacos by alibaba.

the class NamingTpsMonitor method registerDistroMonitorPoint.

private void registerDistroMonitorPoint() {
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_DISTRO_SYNC.name()));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_DISTRO_SYNC_SUCCESS.name()));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_DISTRO_SYNC_FAIL.name()));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_DISTRO_VERIFY.name()));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_DISTRO_VERIFY_SUCCESS.name()));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_DISTRO_VERIFY_FAIL.name()));
}
Also used : TpsMonitorPoint(com.alibaba.nacos.core.remote.control.TpsMonitorPoint)

Example 3 with TpsMonitorPoint

use of com.alibaba.nacos.core.remote.control.TpsMonitorPoint in project nacos by alibaba.

the class RequestHandlerRegistry method onApplicationEvent.

@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
    Map<String, RequestHandler> beansOfType = event.getApplicationContext().getBeansOfType(RequestHandler.class);
    Collection<RequestHandler> values = beansOfType.values();
    for (RequestHandler requestHandler : values) {
        Class<?> clazz = requestHandler.getClass();
        boolean skip = false;
        while (!clazz.getSuperclass().equals(RequestHandler.class)) {
            if (clazz.getSuperclass().equals(Object.class)) {
                skip = true;
                break;
            }
            clazz = clazz.getSuperclass();
        }
        if (skip) {
            continue;
        }
        try {
            Method method = clazz.getMethod("handle", Request.class, RequestMeta.class);
            if (method.isAnnotationPresent(TpsControl.class) && TpsControlConfig.isTpsControlEnabled()) {
                TpsControl tpsControl = method.getAnnotation(TpsControl.class);
                String pointName = tpsControl.pointName();
                TpsMonitorPoint tpsMonitorPoint = new TpsMonitorPoint(pointName);
                tpsMonitorManager.registerTpsControlPoint(tpsMonitorPoint);
            }
        } catch (Exception e) {
        // ignore.
        }
        Class tClass = (Class) ((ParameterizedType) clazz.getGenericSuperclass()).getActualTypeArguments()[0];
        registryHandlers.putIfAbsent(tClass.getSimpleName(), requestHandler);
    }
}
Also used : ParameterizedType(java.lang.reflect.ParameterizedType) TpsControl(com.alibaba.nacos.core.remote.control.TpsControl) TpsMonitorPoint(com.alibaba.nacos.core.remote.control.TpsMonitorPoint) Method(java.lang.reflect.Method)

Example 4 with TpsMonitorPoint

use of com.alibaba.nacos.core.remote.control.TpsMonitorPoint in project nacos by alibaba.

the class NamingTpsMonitor method registerPushMonitorPoint.

private void registerPushMonitorPoint() {
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_RPC_PUSH.name()));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_RPC_PUSH_SUCCESS.name()));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_RPC_PUSH_FAIL.name()));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_UDP_PUSH.name()));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_UDP_PUSH_SUCCESS.name()));
    tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_UDP_PUSH_FAIL.name()));
}
Also used : TpsMonitorPoint(com.alibaba.nacos.core.remote.control.TpsMonitorPoint)

Aggregations

TpsMonitorPoint (com.alibaba.nacos.core.remote.control.TpsMonitorPoint)4 TpsControl (com.alibaba.nacos.core.remote.control.TpsControl)1 Method (java.lang.reflect.Method)1 ParameterizedType (java.lang.reflect.ParameterizedType)1 PostConstruct (javax.annotation.PostConstruct)1