类 ServerLoaderController


  • @RestController
    @RequestMapping("/v2/core/loader")
    public class ServerLoaderController
    extends java.lang.Object
    controller to control server loader.
    版本:
    $Id: ServerLoaderController.java, v 0.1 2020年07月22日 4:28 PM liuzunfei Exp $
    作者:
    liuzunfei
    • 字段详细资料

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • X_REAL_IP

        private static final java.lang.String X_REAL_IP
        另请参阅:
        常量字段值
      • X_FORWARDED_FOR

        private static final java.lang.String X_FORWARDED_FOR
        另请参阅:
        常量字段值
      • X_FORWARDED_FOR_SPLIT_SYMBOL

        private static final java.lang.String X_FORWARDED_FOR_SPLIT_SYMBOL
        另请参阅:
        常量字段值
      • SUCCESS_RESULT

        private static final java.lang.String SUCCESS_RESULT
        另请参阅:
        常量字段值
      • FAIL_RESULT

        private static final java.lang.String FAIL_RESULT
        另请参阅:
        常量字段值
      • SDK_CONNECTION_COUNT_METRIC

        private static final java.lang.String SDK_CONNECTION_COUNT_METRIC
        另请参阅:
        常量字段值
    • 方法详细资料

      • currentClients

        @GetMapping("/current")
        public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String,​Connection>> currentClients()
        Get current clients.
        返回:
        state json.
      • reloadCount

        @GetMapping("/reloadCurrent")
        public org.springframework.http.ResponseEntity<java.lang.String> reloadCount​(@RequestParam
                                                                                     java.lang.Integer count,
                                                                                     @RequestParam(value="redirectAddress",required=false)
                                                                                     java.lang.String redirectAddress)
        Rebalance the number of sdk connections on the current server.
        返回:
        state json.
      • smartReload

        @GetMapping("/smartReloadCluster")
        public org.springframework.http.ResponseEntity<java.lang.String> smartReload​(javax.servlet.http.HttpServletRequest request,
                                                                                     @RequestParam(value="loaderFactor",required=false)
                                                                                     java.lang.String loaderFactorStr,
                                                                                     @RequestParam(value="force",required=false)
                                                                                     java.lang.String force)
        According to the total number of sdk connections of all nodes in the nacos cluster, intelligently balance the number of sdk connections of each node in the nacos cluster.
        返回:
        state json.
      • reloadSingle

        @GetMapping("/reloadClient")
        public org.springframework.http.ResponseEntity<java.lang.String> reloadSingle​(@RequestParam
                                                                                      java.lang.String connectionId,
                                                                                      @RequestParam(value="redirectAddress",required=false)
                                                                                      java.lang.String redirectAddress)
        Send a ConnectResetRequest to this connection according to the sdk connection ID.
        返回:
        state json.
      • loaderMetrics

        @GetMapping("/cluster")
        public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String,​java.lang.Object>> loaderMetrics()
        Get current clients.
        返回:
        state json.
      • getServerLoadMetrics

        private java.util.Map<java.lang.String,​java.lang.Object> getServerLoadMetrics()
      • getRemoteIp

        private static java.lang.String getRemoteIp​(javax.servlet.http.HttpServletRequest request)