Skip to content

Commit

Permalink
[#noissue] Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Oct 14, 2022
1 parent 154864c commit 8f95399
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
*/
public class UriExtractorChain<T> implements UriExtractor<T> {

private final List<UriExtractor<T>> uriExtractorList;
private final UriExtractor<T>[] uriExtractorList;

public UriExtractorChain(List<UriExtractor<T>> uriExtractorList) {
if (CollectionUtils.isEmpty(uriExtractorList)) {
throw new IllegalArgumentException("uriExtractorList may not be empty");
}
this.uriExtractorList = uriExtractorList;
this.uriExtractorList = uriExtractorList.toArray(new UriExtractor[0]);
}

@Override
public UriExtractorType getExtractorType() {
return uriExtractorList.get(0).getExtractorType();
return uriExtractorList[0].getExtractorType();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public PinotUriStatDao(KafkaTemplate<String, UriStat> kafkaUriStatTemplate,
public void insert(List<UriStat> data) {
Objects.requireNonNull(data);

for(UriStat uriStat : data) {
for (UriStat uriStat : data) {
this.kafkaUriStatTemplate.send(topic, uriStat.getApplicationName(), uriStat);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

package com.navercorp.pinpoint.profiler.context.storage;

import com.google.common.util.concurrent.Uninterruptibles;
import com.navercorp.pinpoint.profiler.monitor.metric.uri.AgentUriStatData;
import com.navercorp.pinpoint.profiler.monitor.metric.uri.EachUriStatData;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.Collection;
import java.util.Random;
import java.util.concurrent.TimeUnit;

/**
* @author Taejin Koo
Expand All @@ -44,21 +46,15 @@ public void storageTest() {

long sleepTime = System.currentTimeMillis() % collectInterval;

try {
Thread.sleep(sleepTime + 2);
} catch (InterruptedException e) {
}
Uninterruptibles.sleepUninterruptibly(sleepTime + 2, TimeUnit.MILLISECONDS);

for (int i = 0; i < storeCount; i++) {
storeRandomValue(storage);
}

Assertions.assertNull(storage.poll());

try {
Thread.sleep(collectInterval);
} catch (InterruptedException e) {
}
Uninterruptibles.sleepUninterruptibly(collectInterval, TimeUnit.MILLISECONDS);

storage.pollTimeout(collectInterval);

Expand Down

0 comments on commit 8f95399

Please sign in to comment.