use of com.navercorp.pinpoint.profiler.monitor.metric.uri.EachUriStatData in project pinpoint by naver.
the class GrpcUriStatMessageConverter method createPAgentUriStat.
private PAgentUriStat createPAgentUriStat(AgentUriStatData agentUriStatData) {
long baseTimestamp = agentUriStatData.getBaseTimestamp();
PAgentUriStat.Builder builder = PAgentUriStat.newBuilder();
builder.setTimestamp(baseTimestamp);
builder.setBucketVersion(UriStatHistogramBucket.getBucketVersion());
Collection<EachUriStatData> allUriStatData = agentUriStatData.getAllUriStatData();
for (EachUriStatData eachUriStatData : allUriStatData) {
PEachUriStat pEachUriStat = createPEachUriStat(eachUriStatData);
builder.addEachUriStat(pEachUriStat);
}
return builder.build();
}
use of com.navercorp.pinpoint.profiler.monitor.metric.uri.EachUriStatData in project pinpoint by naver.
the class AsyncQueueingUriStatStorageTest method storageTest.
@Test
public void storageTest() {
int collectInterval = 100;
int storeCount = RANDOM.nextInt(5) + 1;
AsyncQueueingUriStatStorage storage = null;
try {
storage = new AsyncQueueingUriStatStorage(5012, 3, "Test-Executor", collectInterval);
long sleepTime = System.currentTimeMillis() % collectInterval;
try {
Thread.sleep(sleepTime + 2);
} catch (InterruptedException e) {
}
for (int i = 0; i < storeCount; i++) {
storeRandomValue(storage);
}
Assert.assertNull(storage.poll());
try {
Thread.sleep(collectInterval);
} catch (InterruptedException e) {
}
storage.pollTimeout(collectInterval);
AgentUriStatData poll = storage.poll();
Assert.assertNotNull(poll);
Collection<EachUriStatData> allUriStatData = poll.getAllUriStatData();
for (EachUriStatData eachUriStatData : allUriStatData) {
storeCount -= eachUriStatData.getTotalHistogram().getCount();
}
Assert.assertEquals(0, storeCount);
} finally {
if (storage != null) {
storage.close();
}
}
}
Aggregations