use of com.navercorp.pinpoint.profiler.metadata.DefaultCachingSqlNormalizer in project pinpoint by naver.
the class DefaultCachingSqlNormalizerTest method testNormalizedSql_cache_expire.
@Test
public void testNormalizedSql_cache_expire() throws Exception {
CachingSqlNormalizer normalizer = new DefaultCachingSqlNormalizer(1);
ParsingResult parsingResult = normalizer.wrapSql("select * from table1");
boolean newCache = normalizer.normalizedSql(parsingResult);
Assert.assertTrue("newCacheState", newCache);
// cache expire
ParsingResult parsingResult2 = normalizer.wrapSql("select * from table2");
boolean cached = normalizer.normalizedSql(parsingResult2);
Assert.assertTrue(cached);
ParsingResult parsingResult1_recached = normalizer.wrapSql("select * from table3");
boolean newCache_parsingResult1_recached = normalizer.normalizedSql(parsingResult1_recached);
Assert.assertTrue(newCache_parsingResult1_recached);
}
use of com.navercorp.pinpoint.profiler.metadata.DefaultCachingSqlNormalizer in project pinpoint by naver.
the class DefaultCachingSqlNormalizerTest method testNormalizedSql.
@Test
public void testNormalizedSql() throws Exception {
CachingSqlNormalizer normalizer = new DefaultCachingSqlNormalizer(1);
ParsingResult parsingResult = normalizer.wrapSql("select * from dual");
boolean newCache = normalizer.normalizedSql(parsingResult);
Assert.assertTrue("newCacheState", newCache);
boolean notCached = normalizer.normalizedSql(parsingResult);
Assert.assertFalse("alreadyCached", notCached);
ParsingResult alreadyCached = normalizer.wrapSql("select * from dual");
boolean notCached2 = normalizer.normalizedSql(alreadyCached);
Assert.assertFalse("alreadyCached2", notCached2);
}
Aggregations