當前位置: 首頁>>代碼示例>>Java>>正文


Java SimonManager.clear方法代碼示例

本文整理匯總了Java中org.javasimon.SimonManager.clear方法的典型用法代碼示例。如果您正苦於以下問題:Java SimonManager.clear方法的具體用法?Java SimonManager.clear怎麽用?Java SimonManager.clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.javasimon.SimonManager的用法示例。


在下文中一共展示了SimonManager.clear方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: managerClearTest

import org.javasimon.SimonManager; //導入方法依賴的package包/類
@Test
public void managerClearTest() throws MalformedObjectNameException {
	String counterName = "test.1";
	ObjectName counterObjectName = new ObjectName(DOMAIN + ":type=" + SimonInfo.COUNTER + ",name=" + counterName);

	String stopwatchName = "test.2";
	ObjectName stopwatchObjectName = new ObjectName(DOMAIN + ":type=" + SimonInfo.STOPWATCH + ",name=" + stopwatchName);

	Assert.assertFalse(mbs.isRegistered(counterObjectName));
	Assert.assertFalse(mbs.isRegistered(stopwatchObjectName));

	SimonManager.getCounter(counterName);
	Assert.assertTrue(mbs.isRegistered(counterObjectName));

	SimonManager.getStopwatch(stopwatchName);
	Assert.assertTrue(mbs.isRegistered(stopwatchObjectName));

	SimonManager.clear();
	Assert.assertFalse(mbs.isRegistered(counterObjectName));
	Assert.assertFalse(mbs.isRegistered(stopwatchObjectName));
}
 
開發者ID:virgo47,項目名稱:javasimon,代碼行數:22,代碼來源:JmxRegistrationCallbackTest.java

示例2: testRequestWithHandlerMethod

import org.javasimon.SimonManager; //導入方法依賴的package包/類
/** Test MVC Interceptor with old school Controller. */
@Test
public void testRequestWithHandlerMethod() throws Exception {
	// Initialize
	SimonManager.clear();
	// Play scenario
	processRequest("request/uri", new HandlerMethod(new Object(), Object.class.getDeclaredMethod("toString")), 500L, "view", 100L);
	// Check that we grabbed something
	Stopwatch stopwatch = (Stopwatch) manager.getSimon("org.javasimon.mvc.Object.toString.ctrl");
	assertNotNull(stopwatch);
	assertEquals(stopwatch.getCounter(), 1);
	stopwatch = (Stopwatch) manager.getSimon("org.javasimon.mvc.Object.toString.view");
	assertNotNull(stopwatch);
	assertEquals(stopwatch.getCounter(), 1);
}
 
開發者ID:virgo47,項目名稱:javasimon,代碼行數:16,代碼來源:MonitoringHandlerInterceptorTest.java

示例3: testRequestWithHandlerObject

import org.javasimon.SimonManager; //導入方法依賴的package包/類
/** Test MVC Interceptor with @RequestMapping method handler. */
@Test
public void testRequestWithHandlerObject() throws InterruptedException {
	// Initialize
	SimonManager.clear();
	// Play scenario
	processRequest("request/uri", new Object(), 500L, "view", 100L);
	// Check that we grabbed something
	Stopwatch stopwatch = (Stopwatch) manager.getSimon("org.javasimon.mvc.Object.ctrl");
	assertNotNull(stopwatch);
	assertEquals(stopwatch.getCounter(), 1);
	stopwatch = (Stopwatch) manager.getSimon("org.javasimon.mvc.Object.view");
	assertNotNull(stopwatch);
	assertEquals(stopwatch.getCounter(), 1);
}
 
開發者ID:virgo47,項目名稱:javasimon,代碼行數:16,代碼來源:MonitoringHandlerInterceptorTest.java

示例4: testStopwatchStartStop

import org.javasimon.SimonManager; //導入方法依賴的package包/類
/** Test call tree. */
@Test
public void testStopwatchStartStop() {
	// Initialisation
	SimonManager.clear();
	// Execute scenario
	// Special indentation represents call tree
	Split rootSplit = startStopwatch("root");
	Split child1Split = startStopwatch("child1");
	Split child11Split = startStopwatch("child1.m1");
	stopStopwatch(child11Split);
	Split child12Split = startStopwatch("child1.m2");
	stopStopwatch(child12Split);
	stopStopwatch(child1Split);
	Split child2Split = startStopwatch("child2");
	Split child21Split = startStopwatch("child2.loop");
	stopStopwatch(child21Split);
	Split child22Split = startStopwatch("child2.loop");
	stopStopwatch(child22Split);
	stopStopwatch(child2Split);
	stopStopwatch(rootSplit);
	// Check result
	assertEquals(rootTreeNode.getChildren().size(), 2);
	assertEquals(rootTreeNode.getSplitCount(), 1);
	CallTreeNode child1Node = rootTreeNode.getChild(NAME_PREFIX + "child1");
	assertEquals(child1Node.getChildren().size(), 2);
	assertEquals(child1Node.getSplitCount(), 1);
	CallTreeNode child11Node = child1Node.getChild(NAME_PREFIX + "child1.m1");
	assertEquals(child11Node.getSplitCount(), 1);
	CallTreeNode child12Node = child1Node.getChild(NAME_PREFIX + "child1.m2");
	assertEquals(child12Node.getSplitCount(), 1);
	CallTreeNode child2Node = rootTreeNode.getChild(NAME_PREFIX + "child2");
	assertEquals(child2Node.getChildren().size(), 1);
	CallTreeNode child21Node = child2Node.getChild(NAME_PREFIX + "child2.loop");
	assertEquals(child21Node.getSplitCount(), 2);
	LOGGER.debug(rootTreeNode.toString());
}
 
開發者ID:virgo47,項目名稱:javasimon,代碼行數:38,代碼來源:CallTreeTest.java

示例5: setUp

import org.javasimon.SimonManager; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {
    SimonManager.clear();
    when(staticPart.toString()).thenReturn(SharedConstants.LABEL);
}
 
開發者ID:stevensouza,項目名稱:automon,代碼行數:6,代碼來源:JavaSimonTest.java

示例6: tearDown

import org.javasimon.SimonManager; //導入方法依賴的package包/類
@After
public void tearDown() throws Exception {
    SimonManager.clear();
}
 
開發者ID:stevensouza,項目名稱:automon,代碼行數:5,代碼來源:JavaSimonTest.java

示例7: cleanup

import org.javasimon.SimonManager; //導入方法依賴的package包/類
@BeforeMethod
public void cleanup() {
	SimonManager.clear();
}
 
開發者ID:virgo47,項目名稱:javasimon,代碼行數:5,代碼來源:MonitoredPointcutStopwatchNameTest.java

示例8: initialize

import org.javasimon.SimonManager; //導入方法依賴的package包/類
public static void initialize() {
	initialized = true;
	SimonManager.clear();
	initStopwatches();
}
 
開發者ID:virgo47,項目名稱:javasimon,代碼行數:6,代碼來源:SimonData.java


注:本文中的org.javasimon.SimonManager.clear方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。