use of com.navercorp.pinpoint.profiler.metadata.Result in project pinpoint by naver.
the class SimpleCacheTest method startKey1.
@Test
public void startKey1() {
SimpleCache<String> cache = new SimpleCache<String>(1);
Result test = cache.put("test");
Assert.assertEquals(-1, test.getId());
}
use of com.navercorp.pinpoint.profiler.metadata.Result in project pinpoint by naver.
the class SimpleCacheTest method startKey0.
@Test
public void startKey0() {
SimpleCache<String> cache = new SimpleCache<String>(1024, 0);
Result test = cache.put("test");
Assert.assertEquals(0, test.getId());
}
use of com.navercorp.pinpoint.profiler.metadata.Result in project pinpoint by naver.
the class SimpleCacheTest method put.
@Test
public void put() {
SimpleCache<String> cache = new SimpleCache<String>();
Result test = cache.put("test");
Assert.assertEquals(-1, test.getId());
Assert.assertTrue(test.isNewValue());
Result recheck = cache.put("test");
Assert.assertEquals(test.getId(), recheck.getId());
Assert.assertFalse(recheck.isNewValue());
Result newValue = cache.put("new");
Assert.assertEquals(1, newValue.getId());
Assert.assertTrue(newValue.isNewValue());
}
use of com.navercorp.pinpoint.profiler.metadata.Result in project pinpoint by naver.
the class MockApiMetaDataService method cacheApi.
@Override
public int cacheApi(final MethodDescriptor methodDescriptor) {
final String fullName = methodDescriptor.getFullName();
final Result result = this.apiCache.put(fullName);
methodDescriptor.setApiId(result.getId());
final ApiMetaData apiMetadata = new ApiMetaData(result.getId(), methodDescriptor.getApiDescriptor(), methodDescriptor.getLineNumber(), methodDescriptor.getType());
this.enhancedDataSender.request(apiMetadata);
return result.getId();
}
Aggregations