mirror of https://github.com/grpc/grpc-java.git
Fix lint warnings found on internal import
This commit is contained in:
parent
7e8b504e3f
commit
38a91f83e1
|
@ -82,7 +82,8 @@ public final class Utils {
|
|||
// Value quantization will be no larger than 1/10^3 = 0.1%.
|
||||
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() {
|
||||
}
|
||||
|
|
|
@ -60,7 +60,6 @@ import org.HdrHistogram.Recorder;
|
|||
import org.apache.commons.math3.distribution.ExponentialDistribution;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
@ -106,8 +105,8 @@ class LoadClient {
|
|||
config.hasSecurityParams(),
|
||||
config.hasSecurityParams() && config.getSecurityParams().getUseTestCa(),
|
||||
config.hasSecurityParams()
|
||||
? config.getSecurityParams().getServerHostOverride() :
|
||||
null,
|
||||
? config.getSecurityParams().getServerHostOverride()
|
||||
: null,
|
||||
true,
|
||||
Utils.DEFAULT_FLOW_CONTROL_WINDOW,
|
||||
false);
|
||||
|
@ -144,7 +143,7 @@ class LoadClient {
|
|||
} else if (config.getLoadParams().getPoisson() != null) {
|
||||
// Mean of exp distribution per thread is <no threads> / <offered load per second>
|
||||
distribution = new ExponentialDistribution(
|
||||
(double) threadCount / config.getLoadParams().getPoisson().getOfferedLoad());
|
||||
threadCount / config.getLoadParams().getPoisson().getOfferedLoad());
|
||||
} else {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@ -260,15 +259,15 @@ class LoadClient {
|
|||
latenciesBuilder.addBucket(0);
|
||||
base = base * resolution;
|
||||
}
|
||||
latenciesBuilder.setMaxSeen((double) intervalHistogram.getMaxValue());
|
||||
latenciesBuilder.setMinSeen((double) intervalHistogram.getMinNonZeroValue());
|
||||
latenciesBuilder.setMaxSeen(intervalHistogram.getMaxValue());
|
||||
latenciesBuilder.setMinSeen(intervalHistogram.getMinNonZeroValue());
|
||||
latenciesBuilder.setCount(intervalHistogram.getTotalCount());
|
||||
latenciesBuilder.setSum(intervalHistogram.getMean()
|
||||
* intervalHistogram.getTotalCount());
|
||||
// TODO: No support for sum of squares
|
||||
|
||||
statsBuilder.setTimeElapsed(((double)(intervalHistogram.getEndTimeStamp()
|
||||
- intervalHistogram.getStartTimeStamp())) / 1000.0);
|
||||
statsBuilder.setTimeElapsed((intervalHistogram.getEndTimeStamp()
|
||||
- intervalHistogram.getStartTimeStamp()) / 1000.0);
|
||||
if (osBean != null) {
|
||||
// Report all the CPU time as user-time (which is intentionally incorrect)
|
||||
long nowCpu = osBean.getProcessCpuTime();
|
||||
|
@ -323,6 +322,7 @@ class LoadClient {
|
|||
this.stub = stub;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
while (!shutdown) {
|
||||
long now = System.nanoTime();
|
||||
|
@ -432,6 +432,7 @@ class LoadClient {
|
|||
this.channel = channel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
long now;
|
||||
while (!shutdown) {
|
||||
|
@ -456,6 +457,7 @@ class LoadClient {
|
|||
this.channel = channel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
while (!shutdown) {
|
||||
maxOutstanding.acquireUninterruptibly();
|
||||
|
|
|
@ -94,11 +94,11 @@ public class ClientConfiguration implements Configuration {
|
|||
* Constructs a builder for configuring a client application with supported parameters. If no
|
||||
* 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);
|
||||
}
|
||||
|
||||
public static class Builder extends AbstractConfigurationBuilder<ClientConfiguration> {
|
||||
static final class Builder extends AbstractConfigurationBuilder<ClientConfiguration> {
|
||||
private final Collection<Param> supportedParams;
|
||||
|
||||
private Builder(ClientParam... supportedParams) {
|
||||
|
|
|
@ -211,15 +211,15 @@ public class StressTestClient {
|
|||
int numChannels = addresses.size() * channelsPerServer;
|
||||
int numThreads = numChannels * stubsPerChannel;
|
||||
threadpool = MoreExecutors.listeningDecorator(newFixedThreadPool(numThreads));
|
||||
int server_idx = -1;
|
||||
int serverIdx = -1;
|
||||
for (InetSocketAddress address : addresses) {
|
||||
server_idx++;
|
||||
serverIdx++;
|
||||
for (int i = 0; i < channelsPerServer; i++) {
|
||||
ManagedChannel channel = createChannel(address);
|
||||
channels.add(channel);
|
||||
for (int j = 0; j < stubsPerChannel; j++) {
|
||||
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 =
|
||||
new Worker(channel, testCaseWeightPairs, durationSecs, gaugeName);
|
||||
|
||||
|
|
Loading…
Reference in New Issue