com.alibaba.dubbo.monitor.Monitor Java Examples

The following examples show how to use com.alibaba.dubbo.monitor.Monitor. 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: MonitorFilterTest.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
public Monitor getMonitor(final URL url) {
        return new Monitor() {
            public URL getUrl() {
                return url;
            }
            public boolean isAvailable() {
                return true;
            }
            public void destroy() {
            }
            public void collect(URL statistics) {
                MonitorFilterTest.this.lastStatistics = statistics;
            }
public List<URL> lookup(URL query) {
	return Arrays.asList(MonitorFilterTest.this.lastStatistics);
}
        };
    }
 
Example #2
Source File: DubboMonitorFactory.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
@Override
protected Monitor createMonitor(URL url) {
    url = url.setProtocol(url.getParameter(Constants.PROTOCOL_KEY, "dubbo"));
    if (url.getPath() == null || url.getPath().length() == 0) {
        url = url.setPath(MonitorService.class.getName());
    }
    String filter = url.getParameter(Constants.REFERENCE_FILTER_KEY);
    if (filter == null || filter.length() == 0) {
        filter = "";
    } else {
        filter = filter + ",";
    }
    url = url.addParameters(Constants.CLUSTER_KEY, "failsafe", Constants.CHECK_KEY, String.valueOf(false),
            Constants.REFERENCE_FILTER_KEY, filter + "-monitor");
    Invoker<MonitorService> monitorInvoker = protocol.refer(MonitorService.class, url);
    MonitorService monitorService = proxyFactory.getProxy(monitorInvoker);
    return new DubboMonitor(monitorInvoker, monitorService);
}
 
Example #3
Source File: MonitorFilterTest.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public Monitor getMonitor(final URL url) {
        return new Monitor() {
            public URL getUrl() {
                return url;
            }
            public boolean isAvailable() {
                return true;
            }
            public void destroy() {
            }
            public void collect(URL statistics) {
                MonitorFilterTest.this.lastStatistics = statistics;
            }
public List<URL> lookup(URL query) {
	return Arrays.asList(MonitorFilterTest.this.lastStatistics);
}
        };
    }
 
Example #4
Source File: MonitorFilterTest.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
@Override
public Monitor getMonitor(final URL url) {
    return new Monitor() {
        public URL getUrl() {
            return url;
        }

        @Override
        public boolean isAvailable() {
            return true;
        }

        @Override
        public void destroy() {
        }

        public void collect(URL statistics) {
            MonitorFilterTest.this.lastStatistics = statistics;
        }

        public List<URL> lookup(URL query) {
            return Arrays.asList(MonitorFilterTest.this.lastStatistics);
        }
    };
}
 
Example #5
Source File: DubboMonitorFactoryTest.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateMonitor() {
    URL urlWithoutPath = URL.valueOf("http://10.10.10.11");
    Monitor monitor = dubboMonitorFactory.createMonitor(urlWithoutPath);
    assertThat(monitor, not(nullValue()));

    URL urlWithFilterKey = URL.valueOf("http://10.10.10.11/").addParameter(Constants.REFERENCE_FILTER_KEY, "testFilter");
    monitor = dubboMonitorFactory.createMonitor(urlWithFilterKey);

    assertThat(monitor, not(nullValue()));
    ArgumentCaptor<Invoker> invokerArgumentCaptor = ArgumentCaptor.forClass(Invoker.class);
    verify(proxyFactory, atLeastOnce()).getProxy(invokerArgumentCaptor.capture());

    Invoker invoker = invokerArgumentCaptor.getValue();
    assertThat(invoker.getUrl().getParameter(Constants.REFERENCE_FILTER_KEY), containsString("testFilter"));
}
 
Example #6
Source File: AbstractMonitorFactory.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public Monitor getMonitor(URL url) {
	url = url.setPath(MonitorService.class.getName()).addParameter(Constants.INTERFACE_KEY, MonitorService.class.getName());
	String key = url.toServiceString();
    LOCK.lock();
    try {
        Monitor monitor = MONITORS.get(key);
        if (monitor != null) {
            return monitor;
        }
        monitor = createMonitor(url);
        if (monitor == null) {
            throw new IllegalStateException("Can not create monitor " + url);
        }
        MONITORS.put(key, monitor);
        return monitor;
    } finally {
        // 释放锁
        LOCK.unlock();
    }
}
 
Example #7
Source File: AbstractMonitorFactoryTest.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
protected Monitor createMonitor(final URL url) {
    return new Monitor() {

        public URL getUrl() {
            return url;
        }

        @Override
        public boolean isAvailable() {
            return true;
        }

        @Override
        public void destroy() {
        }

        public void collect(URL statistics) {
        }

        public List<URL> lookup(URL query) {
            return null;
        }

    };
}
 
Example #8
Source File: AbstractMonitorFactoryTest.java    From dubbox with Apache License 2.0 6 votes vote down vote up
protected Monitor createMonitor(final URL url) {
        return new Monitor() {

public URL getUrl() {
	return url;
}

public boolean isAvailable() {
	return true;
}

            public void destroy() {
            }
            
public void collect(URL statistics) {
}

public List<URL> lookup(URL query) {
	return null;
}
            
        };
    }
 
Example #9
Source File: MonitorFilterTest.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public Monitor getMonitor(final URL url) {
        return new Monitor() {
            public URL getUrl() {
                return url;
            }
            public boolean isAvailable() {
                return true;
            }
            public void destroy() {
            }
            public void collect(URL statistics) {
                MonitorFilterTest.this.lastStatistics = statistics;
            }
public List<URL> lookup(URL query) {
	return Arrays.asList(MonitorFilterTest.this.lastStatistics);
}
        };
    }
 
Example #10
Source File: DubboMonitorFactroy.java    From dubbox with Apache License 2.0 6 votes vote down vote up
@Override
protected Monitor createMonitor(URL url) {
    url = url.setProtocol(url.getParameter(Constants.PROTOCOL_KEY, "dubbo"));
    if (url.getPath() == null || url.getPath().length() == 0) {
        url = url.setPath(MonitorService.class.getName());
    }
    String filter = url.getParameter(Constants.REFERENCE_FILTER_KEY);
    if (filter == null || filter.length() == 0) {
        filter = "";
    } else {
        filter = filter + ",";
    }
    url = url.addParameters(Constants.CLUSTER_KEY, "failsafe", Constants.CHECK_KEY, String.valueOf(false), 
            Constants.REFERENCE_FILTER_KEY, filter + "-monitor");
    Invoker<MonitorService> monitorInvoker = protocol.refer(MonitorService.class, url);
    MonitorService monitorService = proxyFactory.getProxy(monitorInvoker);
    return new DubboMonitor(monitorInvoker, monitorService);
}
 
Example #11
Source File: DubboMonitorFactroy.java    From dubbox with Apache License 2.0 6 votes vote down vote up
@Override
protected Monitor createMonitor(URL url) {
    url = url.setProtocol(url.getParameter(Constants.PROTOCOL_KEY, "dubbo"));
    if (url.getPath() == null || url.getPath().length() == 0) {
        url = url.setPath(MonitorService.class.getName());
    }
    String filter = url.getParameter(Constants.REFERENCE_FILTER_KEY);
    if (filter == null || filter.length() == 0) {
        filter = "";
    } else {
        filter = filter + ",";
    }
    url = url.addParameters(Constants.CLUSTER_KEY, "failsafe", Constants.CHECK_KEY, String.valueOf(false), 
            Constants.REFERENCE_FILTER_KEY, filter + "-monitor");
    Invoker<MonitorService> monitorInvoker = protocol.refer(MonitorService.class, url);
    MonitorService monitorService = proxyFactory.getProxy(monitorInvoker);
    return new DubboMonitor(monitorInvoker, monitorService);
}
 
Example #12
Source File: AbstractMonitorFactoryTest.java    From dubbox with Apache License 2.0 6 votes vote down vote up
protected Monitor createMonitor(final URL url) {
        return new Monitor() {

public URL getUrl() {
	return url;
}

public boolean isAvailable() {
	return true;
}

            public void destroy() {
            }
            
public void collect(URL statistics) {
}

public List<URL> lookup(URL query) {
	return null;
}
            
        };
    }
 
Example #13
Source File: AbstractMonitorFactoryTest.java    From dubbox with Apache License 2.0 6 votes vote down vote up
protected Monitor createMonitor(final URL url) {
        return new Monitor() {

public URL getUrl() {
	return url;
}

public boolean isAvailable() {
	return true;
}

            public void destroy() {
            }
            
public void collect(URL statistics) {
}

public List<URL> lookup(URL query) {
	return null;
}
            
        };
    }
 
Example #14
Source File: DubboMonitorFactroy.java    From dubbo3 with Apache License 2.0 6 votes vote down vote up
@Override
protected Monitor createMonitor(URL url) {
    url = url.setProtocol(url.getParameter(Constants.PROTOCOL_KEY, "dubbo"));
    if (url.getPath() == null || url.getPath().length() == 0) {
        url = url.setPath(MonitorService.class.getName());
    }
    String filter = url.getParameter(Constants.REFERENCE_FILTER_KEY);
    if (filter == null || filter.length() == 0) {
        filter = "";
    } else {
        filter = filter + ",";
    }
    url = url.addParameters(Constants.CLUSTER_KEY, "failsafe", Constants.CHECK_KEY, String.valueOf(false), 
            Constants.REFERENCE_FILTER_KEY, filter + "-monitor");
    Invoker<MonitorService> monitorInvoker = protocol.refer(MonitorService.class, url);
    MonitorService monitorService = proxyFactory.getProxy(monitorInvoker);
    return new DubboMonitor(monitorInvoker, monitorService);
}
 
Example #15
Source File: MonitorFilterTest.java    From dubbo3 with Apache License 2.0 6 votes vote down vote up
public Monitor getMonitor(final URL url) {
        return new Monitor() {
            public URL getUrl() {
                return url;
            }
            public boolean isAvailable() {
                return true;
            }
            public void destroy() {
            }
            public void collect(URL statistics) {
                MonitorFilterTest.this.lastStatistics = statistics;
            }
public List<URL> lookup(URL query) {
	return Arrays.asList(MonitorFilterTest.this.lastStatistics);
}
        };
    }
 
Example #16
Source File: MonitorFilterTest.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public Monitor getMonitor(final URL url) {
        return new Monitor() {
            public URL getUrl() {
                return url;
            }
            public boolean isAvailable() {
                return true;
            }
            public void destroy() {
            }
            public void collect(URL statistics) {
                MonitorFilterTest.this.lastStatistics = statistics;
            }
public List<URL> lookup(URL query) {
	return Arrays.asList(MonitorFilterTest.this.lastStatistics);
}
        };
    }
 
Example #17
Source File: DubboMonitorFactroy.java    From dubbox with Apache License 2.0 6 votes vote down vote up
@Override
protected Monitor createMonitor(URL url) {
    url = url.setProtocol(url.getParameter(Constants.PROTOCOL_KEY, "dubbo"));
    if (url.getPath() == null || url.getPath().length() == 0) {
        url = url.setPath(MonitorService.class.getName());
    }
    String filter = url.getParameter(Constants.REFERENCE_FILTER_KEY);
    if (filter == null || filter.length() == 0) {
        filter = "";
    } else {
        filter = filter + ",";
    }
    url = url.addParameters(Constants.CLUSTER_KEY, "failsafe", Constants.CHECK_KEY, String.valueOf(false), 
            Constants.REFERENCE_FILTER_KEY, filter + "-monitor");
    Invoker<MonitorService> monitorInvoker = protocol.refer(MonitorService.class, url);
    MonitorService monitorService = proxyFactory.getProxy(monitorInvoker);
    return new DubboMonitor(monitorInvoker, monitorService);
}
 
Example #18
Source File: AbstractMonitorFactoryTest.java    From dubbo3 with Apache License 2.0 6 votes vote down vote up
protected Monitor createMonitor(final URL url) {
        return new Monitor() {

public URL getUrl() {
	return url;
}

public boolean isAvailable() {
	return true;
}

            public void destroy() {
            }
            
public void collect(URL statistics) {
}

public List<URL> lookup(URL query) {
	return null;
}
            
        };
    }
 
Example #19
Source File: AbstractMonitorFactory.java    From dubbo3 with Apache License 2.0 6 votes vote down vote up
public Monitor getMonitor(URL url) {
	url = url.setPath(MonitorService.class.getName()).addParameter(Constants.INTERFACE_KEY, MonitorService.class.getName());
	String key = url.toServiceString();
    LOCK.lock();
    try {
        Monitor monitor = MONITORS.get(key);
        if (monitor != null) {
            return monitor;
        }
        monitor = createMonitor(url);
        if (monitor == null) {
            throw new IllegalStateException("Can not create monitor " + url);
        }
        MONITORS.put(key, monitor);
        return monitor;
    } finally {
        // 释放锁
        LOCK.unlock();
    }
}
 
Example #20
Source File: AbstractMonitorFactory.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
public Monitor getMonitor(URL url) {
	url = url.setPath(MonitorService.class.getName()).addParameter(Constants.INTERFACE_KEY, MonitorService.class.getName());
	String key = url.toServiceString();
    LOCK.lock();
    try {
        Monitor monitor = MONITORS.get(key);
        if (monitor != null) {
            return monitor;
        }
        monitor = createMonitor(url);
        if (monitor == null) {
            throw new IllegalStateException("Can not create monitor " + url);
        }
        MONITORS.put(key, monitor);
        return monitor;
    } finally {
        // 释放锁
        LOCK.unlock();
    }
}
 
Example #21
Source File: AbstractMonitorFactory.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public Monitor getMonitor(URL url) {
	url = url.setPath(MonitorService.class.getName()).addParameter(Constants.INTERFACE_KEY, MonitorService.class.getName());
	String key = url.toServiceString();
    LOCK.lock();
    try {
        Monitor monitor = MONITORS.get(key);
        if (monitor != null) {
            return monitor;
        }
        monitor = createMonitor(url);
        if (monitor == null) {
            throw new IllegalStateException("Can not create monitor " + url);
        }
        MONITORS.put(key, monitor);
        return monitor;
    } finally {
        // 释放锁
        LOCK.unlock();
    }
}
 
Example #22
Source File: DubboMonitorFactroy.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
@Override
protected Monitor createMonitor(URL url) {
    url = url.setProtocol(url.getParameter(Constants.PROTOCOL_KEY, "dubbo"));
    if (url.getPath() == null || url.getPath().length() == 0) {
        url = url.setPath(MonitorService.class.getName());
    }
    String filter = url.getParameter(Constants.REFERENCE_FILTER_KEY);
    if (filter == null || filter.length() == 0) {
        filter = "";
    } else {
        filter = filter + ",";
    }
    url = url.addParameters(Constants.CLUSTER_KEY, "failsafe", Constants.CHECK_KEY, String.valueOf(false), 
            Constants.REFERENCE_FILTER_KEY, filter + "-monitor");
    Invoker<MonitorService> monitorInvoker = protocol.refer(MonitorService.class, url);
    MonitorService monitorService = proxyFactory.getProxy(monitorInvoker);
    return new DubboMonitor(monitorInvoker, monitorService);
}
 
Example #23
Source File: AbstractMonitorFactoryTest.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
protected Monitor createMonitor(final URL url) {
        return new Monitor() {

public URL getUrl() {
	return url;
}

public boolean isAvailable() {
	return true;
}

            public void destroy() {
            }
            
public void collect(URL statistics) {
}

public List<URL> lookup(URL query) {
	return null;
}
            
        };
    }
 
Example #24
Source File: AbstractMonitorFactory.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public Monitor getMonitor(URL url) {
	url = url.setPath(MonitorService.class.getName()).addParameter(Constants.INTERFACE_KEY, MonitorService.class.getName());
	String key = url.toServiceString();
    LOCK.lock();
    try {
        Monitor monitor = MONITORS.get(key);
        if (monitor != null) {
            return monitor;
        }
        monitor = createMonitor(url);
        if (monitor == null) {
            throw new IllegalStateException("Can not create monitor " + url);
        }
        MONITORS.put(key, monitor);
        return monitor;
    } finally {
        // 释放锁
        LOCK.unlock();
    }
}
 
Example #25
Source File: DubboMonitorTest.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
@Test
public void testMonitorFactory() throws Exception {
    MockMonitorService monitorService = new MockMonitorService();
    URL statistics = new URL("dubbo", "10.20.153.10", 0)
            .addParameter(MonitorService.APPLICATION, "morgan")
            .addParameter(MonitorService.INTERFACE, "MemberService")
            .addParameter(MonitorService.METHOD, "findPerson")
            .addParameter(MonitorService.CONSUMER, "10.20.153.11")
            .addParameter(MonitorService.SUCCESS, 1)
            .addParameter(MonitorService.FAILURE, 0)
            .addParameter(MonitorService.ELAPSED, 3)
            .addParameter(MonitorService.MAX_ELAPSED, 3)
            .addParameter(MonitorService.CONCURRENT, 1)
            .addParameter(MonitorService.MAX_CONCURRENT, 1);
    
    Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
    ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
    MonitorFactory monitorFactory = ExtensionLoader.getExtensionLoader(MonitorFactory.class).getAdaptiveExtension();

    Exporter<MonitorService> exporter = protocol.export(proxyFactory.getInvoker(monitorService, MonitorService.class, URL.valueOf("dubbo://127.0.0.1:17979/" + MonitorService.class.getName())));
    try {
        Monitor monitor = monitorFactory.getMonitor(URL.valueOf("dubbo://127.0.0.1:17979?interval=10"));
        try {
            monitor.collect(statistics);
            int i = 0;
            while(monitorService.getStatistics() == null && i < 200) {
                i ++;
                Thread.sleep(10);
            }
            URL result = monitorService.getStatistics();
            Assert.assertEquals(1, result.getParameter(MonitorService.SUCCESS, 0));
            Assert.assertEquals(3, result.getParameter(MonitorService.ELAPSED, 0));
        } finally {
            monitor.destroy();
        }
    } finally {
        exporter.unexport();
    }
}
 
Example #26
Source File: DubboMonitorTest.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
@Test
public void testMonitorFactory() throws Exception {
    MockMonitorService monitorService = new MockMonitorService();
    URL statistics = new URL("dubbo", "10.20.153.10", 0)
            .addParameter(MonitorService.APPLICATION, "morgan")
            .addParameter(MonitorService.INTERFACE, "MemberService")
            .addParameter(MonitorService.METHOD, "findPerson")
            .addParameter(MonitorService.CONSUMER, "10.20.153.11")
            .addParameter(MonitorService.SUCCESS, 1)
            .addParameter(MonitorService.FAILURE, 0)
            .addParameter(MonitorService.ELAPSED, 3)
            .addParameter(MonitorService.MAX_ELAPSED, 3)
            .addParameter(MonitorService.CONCURRENT, 1)
            .addParameter(MonitorService.MAX_CONCURRENT, 1);
    
    Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
    ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
    MonitorFactory monitorFactory = ExtensionLoader.getExtensionLoader(MonitorFactory.class).getAdaptiveExtension();

    Exporter<MonitorService> exporter = protocol.export(proxyFactory.getInvoker(monitorService, MonitorService.class, URL.valueOf("dubbo://127.0.0.1:17979/" + MonitorService.class.getName())));
    try {
        Monitor monitor = monitorFactory.getMonitor(URL.valueOf("dubbo://127.0.0.1:17979?interval=10"));
        try {
            monitor.collect(statistics);
            int i = 0;
            while(monitorService.getStatistics() == null && i < 200) {
                i ++;
                Thread.sleep(10);
            }
            URL result = monitorService.getStatistics();
            Assert.assertEquals(1, result.getParameter(MonitorService.SUCCESS, 0));
            Assert.assertEquals(3, result.getParameter(MonitorService.ELAPSED, 0));
        } finally {
            monitor.destroy();
        }
    } finally {
        exporter.unexport();
    }
}
 
Example #27
Source File: AbstractMonitorFactoryTest.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Test
public void testMonitorFactoryCache() throws Exception {
    URL url = URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostAddress() + ":2233");
    Monitor monitor1 = monitorFactory.getMonitor(url);
    Monitor monitor2 = monitorFactory.getMonitor(url);
    Assert.assertEquals(monitor1, monitor2);
}
 
Example #28
Source File: AbstractMonitorFactoryTest.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Test
public void testMonitorFactoryCache() throws Exception {
    URL url = URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostAddress() + ":2233");
    Monitor monitor1 = monitorFactory.getMonitor(url);
    Monitor monitor2 = monitorFactory.getMonitor(url);
    Assert.assertEquals(monitor1, monitor2);
}
 
Example #29
Source File: AbstractMonitorFactoryTest.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
@Test
public void testMonitorFactoryCache() throws Exception {
    URL url = URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostAddress() + ":2233");
    Monitor monitor1 = monitorFactory.getMonitor(url);
    Monitor monitor2 = monitorFactory.getMonitor(url);
    Assert.assertEquals(monitor1, monitor2);
}
 
Example #30
Source File: DubboMonitorTest.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Test
public void testMonitorFactory() throws Exception {
    MockMonitorService monitorService = new MockMonitorService();
    URL statistics = new URL("dubbo", "10.20.153.10", 0)
            .addParameter(MonitorService.APPLICATION, "morgan")
            .addParameter(MonitorService.INTERFACE, "MemberService")
            .addParameter(MonitorService.METHOD, "findPerson")
            .addParameter(MonitorService.CONSUMER, "10.20.153.11")
            .addParameter(MonitorService.SUCCESS, 1)
            .addParameter(MonitorService.FAILURE, 0)
            .addParameter(MonitorService.ELAPSED, 3)
            .addParameter(MonitorService.MAX_ELAPSED, 3)
            .addParameter(MonitorService.CONCURRENT, 1)
            .addParameter(MonitorService.MAX_CONCURRENT, 1);
    
    Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
    ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
    MonitorFactory monitorFactory = ExtensionLoader.getExtensionLoader(MonitorFactory.class).getAdaptiveExtension();

    Exporter<MonitorService> exporter = protocol.export(proxyFactory.getInvoker(monitorService, MonitorService.class, URL.valueOf("dubbo://127.0.0.1:17979/" + MonitorService.class.getName())));
    try {
        Monitor monitor = monitorFactory.getMonitor(URL.valueOf("dubbo://127.0.0.1:17979?interval=10"));
        try {
            monitor.collect(statistics);
            int i = 0;
            while(monitorService.getStatistics() == null && i < 200) {
                i ++;
                Thread.sleep(10);
            }
            URL result = monitorService.getStatistics();
            Assert.assertEquals(1, result.getParameter(MonitorService.SUCCESS, 0));
            Assert.assertEquals(3, result.getParameter(MonitorService.ELAPSED, 0));
        } finally {
            monitor.destroy();
        }
    } finally {
        exporter.unexport();
    }
}