Fix lint warnings found on internal import

This commit is contained in:
Carl Mastrangelo 2016-04-26 13:21:25 -07:00
parent 7e8b504e3f
commit 38a91f83e1
5 changed files with 18 additions and 15 deletions

View File

@ -82,7 +82,8 @@ public final class Utils {
// Value quantization will be no larger than 1/10^3 = 0.1%. // Value quantization will be no larger than 1/10^3 = 0.1%.
public static final int HISTOGRAM_PRECISION = 3; public static final int HISTOGRAM_PRECISION = 3;
public static int DEFAULT_FLOW_CONTROL_WINDOW = NettyChannelBuilder.DEFAULT_FLOW_CONTROL_WINDOW; public static final int DEFAULT_FLOW_CONTROL_WINDOW =
NettyChannelBuilder.DEFAULT_FLOW_CONTROL_WINDOW;
private Utils() { private Utils() {
} }

View File

@ -60,7 +60,6 @@ import org.HdrHistogram.Recorder;
import org.apache.commons.math3.distribution.ExponentialDistribution; import org.apache.commons.math3.distribution.ExponentialDistribution;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
@ -106,8 +105,8 @@ class LoadClient {
config.hasSecurityParams(), config.hasSecurityParams(),
config.hasSecurityParams() && config.getSecurityParams().getUseTestCa(), config.hasSecurityParams() && config.getSecurityParams().getUseTestCa(),
config.hasSecurityParams() config.hasSecurityParams()
? config.getSecurityParams().getServerHostOverride() : ? config.getSecurityParams().getServerHostOverride()
null, : null,
true, true,
Utils.DEFAULT_FLOW_CONTROL_WINDOW, Utils.DEFAULT_FLOW_CONTROL_WINDOW,
false); false);
@ -144,7 +143,7 @@ class LoadClient {
} else if (config.getLoadParams().getPoisson() != null) { } else if (config.getLoadParams().getPoisson() != null) {
// Mean of exp distribution per thread is <no threads> / <offered load per second> // Mean of exp distribution per thread is <no threads> / <offered load per second>
distribution = new ExponentialDistribution( distribution = new ExponentialDistribution(
(double) threadCount / config.getLoadParams().getPoisson().getOfferedLoad()); threadCount / config.getLoadParams().getPoisson().getOfferedLoad());
} else { } else {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -260,15 +259,15 @@ class LoadClient {
latenciesBuilder.addBucket(0); latenciesBuilder.addBucket(0);
base = base * resolution; base = base * resolution;
} }
latenciesBuilder.setMaxSeen((double) intervalHistogram.getMaxValue()); latenciesBuilder.setMaxSeen(intervalHistogram.getMaxValue());
latenciesBuilder.setMinSeen((double) intervalHistogram.getMinNonZeroValue()); latenciesBuilder.setMinSeen(intervalHistogram.getMinNonZeroValue());
latenciesBuilder.setCount(intervalHistogram.getTotalCount()); latenciesBuilder.setCount(intervalHistogram.getTotalCount());
latenciesBuilder.setSum(intervalHistogram.getMean() latenciesBuilder.setSum(intervalHistogram.getMean()
* intervalHistogram.getTotalCount()); * intervalHistogram.getTotalCount());
// TODO: No support for sum of squares // TODO: No support for sum of squares
statsBuilder.setTimeElapsed(((double)(intervalHistogram.getEndTimeStamp() statsBuilder.setTimeElapsed((intervalHistogram.getEndTimeStamp()
- intervalHistogram.getStartTimeStamp())) / 1000.0); - intervalHistogram.getStartTimeStamp()) / 1000.0);
if (osBean != null) { if (osBean != null) {
// Report all the CPU time as user-time (which is intentionally incorrect) // Report all the CPU time as user-time (which is intentionally incorrect)
long nowCpu = osBean.getProcessCpuTime(); long nowCpu = osBean.getProcessCpuTime();
@ -323,6 +322,7 @@ class LoadClient {
this.stub = stub; this.stub = stub;
} }
@Override
public void run() { public void run() {
while (!shutdown) { while (!shutdown) {
long now = System.nanoTime(); long now = System.nanoTime();
@ -432,6 +432,7 @@ class LoadClient {
this.channel = channel; this.channel = channel;
} }
@Override
public void run() { public void run() {
long now; long now;
while (!shutdown) { while (!shutdown) {
@ -456,6 +457,7 @@ class LoadClient {
this.channel = channel; this.channel = channel;
} }
@Override
public void run() { public void run() {
while (!shutdown) { while (!shutdown) {
maxOutstanding.acquireUninterruptibly(); maxOutstanding.acquireUninterruptibly();

View File

@ -94,11 +94,11 @@ public class ClientConfiguration implements Configuration {
* Constructs a builder for configuring a client application with supported parameters. If no * Constructs a builder for configuring a client application with supported parameters. If no
* parameters are provided, all parameters are assumed to be supported. * parameters are provided, all parameters are assumed to be supported.
*/ */
public static Builder newBuilder(ClientParam... supportedParams) { static Builder newBuilder(ClientParam... supportedParams) {
return new Builder(supportedParams); return new Builder(supportedParams);
} }
public static class Builder extends AbstractConfigurationBuilder<ClientConfiguration> { static final class Builder extends AbstractConfigurationBuilder<ClientConfiguration> {
private final Collection<Param> supportedParams; private final Collection<Param> supportedParams;
private Builder(ClientParam... supportedParams) { private Builder(ClientParam... supportedParams) {

View File

@ -211,15 +211,15 @@ public class StressTestClient {
int numChannels = addresses.size() * channelsPerServer; int numChannels = addresses.size() * channelsPerServer;
int numThreads = numChannels * stubsPerChannel; int numThreads = numChannels * stubsPerChannel;
threadpool = MoreExecutors.listeningDecorator(newFixedThreadPool(numThreads)); threadpool = MoreExecutors.listeningDecorator(newFixedThreadPool(numThreads));
int server_idx = -1; int serverIdx = -1;
for (InetSocketAddress address : addresses) { for (InetSocketAddress address : addresses) {
server_idx++; serverIdx++;
for (int i = 0; i < channelsPerServer; i++) { for (int i = 0; i < channelsPerServer; i++) {
ManagedChannel channel = createChannel(address); ManagedChannel channel = createChannel(address);
channels.add(channel); channels.add(channel);
for (int j = 0; j < stubsPerChannel; j++) { for (int j = 0; j < stubsPerChannel; j++) {
String gaugeName = String gaugeName =
String.format("/stress_test/server_%d/channel_%d/stub_%d/qps", server_idx, i, j); String.format("/stress_test/server_%d/channel_%d/stub_%d/qps", serverIdx, i, j);
Worker worker = Worker worker =
new Worker(channel, testCaseWeightPairs, durationSecs, gaugeName); new Worker(channel, testCaseWeightPairs, durationSecs, gaugeName);