com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet Java Examples

The following examples show how to use com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HystrixDashboardConfig.java    From cloud-template with MIT License 5 votes vote down vote up
@Bean
public ServletRegistrationBean getServlet() {
    HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
    registrationBean.setLoadOnStartup(1);
    registrationBean.addUrlMappings("/hystrix.stream");
    registrationBean.setName("HystrixMetricsStreamServlet");
    return registrationBean;
}
 
Example #2
Source File: TenacityConfiguredBundle.java    From tenacity with Apache License 2.0 5 votes vote down vote up
protected void addTenacityResources(Environment environment,
                                    TenacityPropertyKeyFactory keyFactory,
                                    Collection<TenacityPropertyKey> tenacityPropertyKeys) {
    final String tenacityMetricsStream = "/tenacity/metrics.stream";
    final TenacityConfigurationResource configurationResource = new TenacityConfigurationResource(keyFactory);
    final TenacityCircuitBreakersResource circuitBreakersResource =
            new TenacityCircuitBreakersResource(tenacityPropertyKeys, keyFactory);
    final TenacityPropertyKeysResource propertyKeysResource = new TenacityPropertyKeysResource(tenacityPropertyKeys);

    if (usingAdminPort) {
        environment.admin()
                .addServlet(tenacityMetricsStream, new HystrixMetricsStreamServlet())
                .addMapping(tenacityMetricsStream);
        environment.admin()
                .addServlet(TenacityPropertyKeysResource.PATH,
                        new TenacityPropertyKeysServlet(environment.getObjectMapper(), propertyKeysResource))
                .addMapping(TenacityPropertyKeysResource.PATH);
        environment.admin()
                .addServlet(TenacityConfigurationResource.PATH,
                        new TenacityConfigurationServlet(environment.getObjectMapper(), configurationResource))
                .addMapping(TenacityConfigurationResource.PATH + "/*");
        environment.admin()
                .addServlet(TenacityCircuitBreakersResource.PATH,
                        new TenacityCircuitBreakersServlet(environment.getObjectMapper(), circuitBreakersResource))
                .addMapping(TenacityCircuitBreakersResource.PATH + "/*");
    } else {
        environment.servlets()
                .addServlet(tenacityMetricsStream, new HystrixMetricsStreamServlet())
                .addMapping(tenacityMetricsStream);
        environment.jersey().register(propertyKeysResource);
        environment.jersey().register(configurationResource);
        environment.jersey().register(circuitBreakersResource);
    }
}
 
Example #3
Source File: HystrixApplication.java    From blog with MIT License 5 votes vote down vote up
@Bean
public ServletRegistrationBean getServlet() {
  HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
  ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
  registrationBean.setLoadOnStartup(1);
  registrationBean.addUrlMappings("/hystrix.stream");
  registrationBean.setName("HystrixMetricsStreamServlet");
  return registrationBean;
}
 
Example #4
Source File: MonitorAutoconfiguration.java    From saluki with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletRegistrationBean registration(HystrixMetricsStreamServlet servlet) {
    ServletRegistrationBean registrationBean = new ServletRegistrationBean();
    registrationBean.setServlet(servlet);
    registrationBean.setEnabled(true);
    registrationBean.addUrlMappings("/hystrix.stream");
    return registrationBean;
}
 
Example #5
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixForTurbineRegistrationBean")
public ServletRegistrationBean servletTurbineRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/actuator/hystrix.stream");
    registration.setName("hystrixForTurbineServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #6
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixRegistrationBean")
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/hystrix.stream");
    registration.setName("hystrixServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #7
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixForTurbineRegistrationBean")
public ServletRegistrationBean servletTurbineRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/actuator/hystrix.stream");
    registration.setName("hystrixForTurbineServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #8
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixRegistrationBean")
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/hystrix.stream");
    registration.setName("hystrixServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #9
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixForTurbineRegistrationBean")
public ServletRegistrationBean servletTurbineRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/actuator/hystrix.stream");
    registration.setName("hystrixForTurbineServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #10
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixRegistrationBean")
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/hystrix.stream");
    registration.setName("hystrixServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #11
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixForTurbineRegistrationBean")
public ServletRegistrationBean servletTurbineRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/actuator/hystrix.stream");
    registration.setName("hystrixForTurbineServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #12
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixRegistrationBean")
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/hystrix.stream");
    registration.setName("hystrixServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #13
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixForTurbineRegistrationBean")
public ServletRegistrationBean servletTurbineRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/actuator/hystrix.stream");
    registration.setName("hystrixForTurbineServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #14
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixRegistrationBean")
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/hystrix.stream");
    registration.setName("hystrixServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #15
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixForTurbineRegistrationBean")
public ServletRegistrationBean servletTurbineRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/actuator/hystrix.stream");
    registration.setName("hystrixForTurbineServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #16
Source File: MonitorConfig.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletRegistrationBean getServlet() {
    HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
    registrationBean.setLoadOnStartup(1);
    registrationBean.addUrlMappings("/hystrix.stream");
    registrationBean.setName("HystrixMetricsStreamServlet");
    return registrationBean;
}
 
Example #17
Source File: HystrixDashboardConfiger.java    From HIS with Apache License 2.0 5 votes vote down vote up
/**
 *
 * 地址/hystrix
 */
@Bean
public ServletRegistrationBean getServlet() {
    HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);  //Spring boot 以代码的方式装载servlet
    registrationBean.setLoadOnStartup(1); //设置启动顺序
    registrationBean.addUrlMappings("/hystrix.stream");
    registrationBean.setName("HystrixMetricsStreamServlet");
    return registrationBean;
}
 
Example #18
Source File: OrderApplication.java    From code with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletRegistrationBean getServlet(){
    HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
    registrationBean.setLoadOnStartup(1);
    registrationBean.addUrlMappings("/hystrix.stream");/*/actuator/hystrix.stream*/
    registrationBean.setName("HystrixMetricsStreamServlet");
    return registrationBean;
}
 
Example #19
Source File: HystrixDashboardConfiger.java    From HIS with Apache License 2.0 5 votes vote down vote up
/**
 *
 * 地址/hystrix
 */
@Bean
public ServletRegistrationBean getServlet() {
    HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);  //Spring boot 以代码的方式装载servlet
    registrationBean.setLoadOnStartup(1); //设置启动顺序
    registrationBean.addUrlMappings("/hystrix.stream");
    registrationBean.setName("HystrixMetricsStreamServlet");
    return registrationBean;
}
 
Example #20
Source File: KittyConsumerApplication.java    From kitty with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public ServletRegistrationBean getServlet() {
	HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
	ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
	registrationBean.setLoadOnStartup(1);
	registrationBean.addUrlMappings("/hystrix.stream");
	registrationBean.setName("HystrixMetricsStreamServlet");
	return registrationBean;
}
 
Example #21
Source File: EurekaRibbonConfig.java    From fw-spring-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * 解决dashboard显示 Unable to connect to Command Metric Stream
 */
@Bean
public ServletRegistrationBean getServlet() {
    HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
    registrationBean.setLoadOnStartup(1);
    registrationBean.addUrlMappings("/hystrix.stream");
    registrationBean.setName("HystrixMetricsStreamServlet");
    return registrationBean;
}
 
Example #22
Source File: HystrixConfig.java    From light-reading-cloud with MIT License 5 votes vote down vote up
@Bean
public ServletRegistrationBean getServlet() {
    HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
    registrationBean.setLoadOnStartup(1);
    registrationBean.addUrlMappings("/hystrix.stream");
    registrationBean.setName("HystrixMetricsStreamServlet");
    return registrationBean;
}
 
Example #23
Source File: ServiceRibbonApplication.java    From SpringCloud-Finchley-samples with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletRegistrationBean getServlet() {
	HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
	ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
	registrationBean.setLoadOnStartup(1);
	registrationBean.addUrlMappings("/hystrix.stream");
	registrationBean.setName("HystrixMetricsStreamServlet");
	return registrationBean;

}
 
Example #24
Source File: HystrixConfig.java    From spring-cloud-learning with MIT License 5 votes vote down vote up
@Bean
@SuppressWarnings("unchecked")
public ServletRegistrationBean getServlet() {
    HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
    registrationBean.setLoadOnStartup(1);
    registrationBean.addUrlMappings("/hystrix.stream");
    registrationBean.setName("HystrixMetricsStreamServlet");
    return registrationBean;
}
 
Example #25
Source File: HystrixServlet.java    From springcloud-study with Apache License 2.0 5 votes vote down vote up
/**
	 *  指定 hystrix 的路径
	 * @return
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
//	@Bean
    public ServletRegistrationBean getServlet() {
        HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
        registrationBean.setLoadOnStartup(1);
        registrationBean.addUrlMappings("/hystrix.stream");
        registrationBean.setName("HystrixMetricsStreamServlet");
        return registrationBean;
    }
 
Example #26
Source File: InfoBoard.java    From s2g-zuul with MIT License 5 votes vote down vote up
public InfoBoard(String appName, int port) {
	this.appName = appName;
	this.server = new Server(port);
	this.statusInfo = new StatusInfo();
	this.jvmStatsReporter = new JvmStatsReporter(appName, 60000);
	this.jvmStatsReporter.addStatsHandler(statusInfo);
	this.jvmStatsReporter.start();
	try {
		ServletContextHandler handler = new ServletContextHandler();
		handler.setContextPath("/");

		handler.setSessionHandler(new SessionHandler());

		handler.addServlet(EnvServlet.class, "/api/env");
		handler.addServlet(PropsServlet.class, "/api/props");
		handler.addServlet(StaticServlet.class, "/*");
		handler.addServlet(HystrixServlet.class, "/breaker");
           handler.addServlet(HystrixMetricsStreamServlet.class, "/hystrix.stream");
		handler.addServlet(new ServletHolder(new StatusServlet(statusInfo)), "/api/status");

		server.setHandler(handler);

	} catch (Exception e) {
		logger.error("start jetty error!", e);
	}

}
 
Example #27
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixRegistrationBean")
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/hystrix.stream");
    registration.setName("hystrixServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #28
Source File: HystrixConfiguration.java    From springcloud-course with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "hystrixRegistrationBean")
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean registration = new ServletRegistrationBean(
            new HystrixMetricsStreamServlet(), "/hystrix.stream");
    registration.setName("hystrixServlet");
    registration.setLoadOnStartup(1);
    return registration;
}
 
Example #29
Source File: MonitorAutoconfiguration.java    From saluki with Apache License 2.0 4 votes vote down vote up
@Bean
public HystrixMetricsStreamServlet hystrixMetricsStreamServlet() {
    return new HystrixMetricsStreamServlet();
}
 
Example #30
Source File: HystrixServletConfiguration.java    From ola with Apache License 2.0 4 votes vote down vote up
@Bean
public ServletRegistrationBean jerseyServlet() {
    ServletRegistrationBean registration = new ServletRegistrationBean(new HystrixMetricsStreamServlet(), "/hystrix.stream");
    return registration;
}