Skip to content

Commit

Permalink
issue SLTM-1076 resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Kurilov committed Aug 18, 2017
1 parent 9eff559 commit c06700d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 18 deletions.
4 changes: 2 additions & 2 deletions config/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"fsAccess" : false,
"headers" : {
"Connection" : "Keep-Alive",
"User-Agent" : "mongoose/3.4.1"
"User-Agent" : "mongoose/3.4.2"
},
"namespace" : null,
"versioning" : false
Expand Down Expand Up @@ -172,7 +172,7 @@
"precondition" : false
}
},
"version" : "3.4.1",
"version" : "3.4.2",
"aliasing" : [
{
"name" : "load-threads",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public class BasicLoadController<I extends Item, O extends IoTask<I>>
**/
public BasicLoadController(
final String name, final Map<LoadGenerator<I, O>, List<StorageDriver<I, O>>> driversMap,
final Int2IntMap weightMap, final Map<LoadGenerator<I, O>, LoadConfig> loadConfigs,
final Int2IntMap weightMap, final Map<LoadGenerator<I, O>, SizeInBytes> itemDataSizes,
final Map<LoadGenerator<I, O>, LoadConfig> loadConfigs,
final Map<LoadGenerator<I, O>, StepConfig> stepConfigs
) {
this.name = name;
Expand Down Expand Up @@ -175,7 +176,7 @@ public BasicLoadController(
new BasicMetricsContext(
name, ioType, nextDrivers.size(), ioTypeSpecificConcurrency,
(int) (ioTypeSpecificConcurrency * metricsConfig.getThreshold()),
nextGenerator.getTransferSizeEstimate(), preconditionJobFlag, metricsPeriodSec
itemDataSizes.get(nextGenerator), preconditionJobFlag, metricsPeriodSec
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public final void formatTo(final StringBuilder buffer) {
buffer.append("clients=\"").append(driversCount).append("\" ");
buffer.append("error=\"").append(snapshot.getFailCount()).append("\" ");
buffer.append("runtime=\"").append(((float) elapsedTimeMillis) / 1000).append("\" ");
final String transferSize = SizeInBytes.formatFixedSize(metricsCtx.getTransferSizeEstimate());
buffer.append("filesize=\"").append(transferSize).append("\" ");
final String itemDataSizeStr = SizeInBytes.formatFixedSize(metricsCtx.getItemDataSize());
buffer.append("filesize=\"").append(itemDataSizeStr).append("\" ");
buffer.append("tps=\"").append(snapshot.getSuccRateMean()).append("\" tps_unit=\"Fileps\" ");
buffer.append("bw=\"").append(snapshot.getByteRateMean() / MIB).append("\" bw_unit=\"MBps\" ");
buffer.append("latency=\"").append(snapshot.getLatencyMean()).append("\" latency_unit=\"us\" ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class BasicMetricsContext
private final int driverCount;
private final int concurrency;
private final int thresholdConcurrency;
private final long transferSizeEstimate;
private final SizeInBytes itemDataSize;
private final boolean volatileOutputFlag;
private final long outputPeriodMillis;
private volatile long lastOutputTs = 0;
Expand All @@ -43,7 +43,7 @@ public final class BasicMetricsContext
//
public BasicMetricsContext(
final String stepName, final IoType ioType, final int driverCount, final int concurrency,
final int thresholdConcurrency, final long transferSizeEstimate,
final int thresholdConcurrency, final SizeInBytes itemDataSize,
final boolean volatileOutputFlag, final int updateIntervalSec
) {
this.stepName = stepName;
Expand All @@ -52,7 +52,7 @@ public BasicMetricsContext(
this.concurrency = concurrency;
this.thresholdConcurrency = thresholdConcurrency > 0 ?
thresholdConcurrency : Integer.MAX_VALUE;
this.transferSizeEstimate = transferSizeEstimate;
this.itemDataSize = itemDataSize;
this.volatileOutputFlag = volatileOutputFlag;
this.outputPeriodMillis = TimeUnit.SECONDS.toMillis(updateIntervalSec);
respLatency = new Histogram(new SlidingWindowReservoir(0x1_00_00));
Expand Down Expand Up @@ -205,8 +205,8 @@ public final int getConcurrencyThreshold() {
}
//
@Override
public final long getTransferSizeEstimate() {
return transferSizeEstimate;
public final SizeInBytes getItemDataSize() {
return itemDataSize;
}
//
@Override
Expand Down Expand Up @@ -271,7 +271,7 @@ public final void enterThresholdState()
throw new IllegalStateException("Nested metrics context already exists");
}
thresholdMetricsCtx = new BasicMetricsContext(
stepName, ioType, driverCount, concurrency, 0, transferSizeEstimate, volatileOutputFlag,
stepName, ioType, driverCount, concurrency, 0, itemDataSize, volatileOutputFlag,
(int) TimeUnit.MILLISECONDS.toSeconds(outputPeriodMillis)
);
thresholdMetricsCtx.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void markSucc(
int getDriverCount();
int getConcurrency();
int getConcurrencyThreshold();
long getTransferSizeEstimate();
SizeInBytes getItemDataSize();
boolean getVolatileOutputFlag();
long getOutputPeriodMillis();
long getLastOutputTs();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.emc.mongoose.run.scenario.step;

import com.emc.mongoose.common.api.SizeInBytes;
import com.emc.mongoose.common.exception.UserShootHisFootException;
import com.emc.mongoose.common.io.Output;
import com.emc.mongoose.load.generator.BasicLoadGeneratorBuilder;
Expand Down Expand Up @@ -136,12 +137,14 @@ protected final void invoke() {

final Map<LoadGenerator, List<StorageDriver>> driversMap = new HashMap<>();
driversMap.put(loadGenerator, drivers);
final Map<LoadGenerator, SizeInBytes> itemDataSizes = new HashMap<>();
itemDataSizes.put(loadGenerator, dataConfig.getSize());
final Map<LoadGenerator, LoadConfig> loadConfigMap = new HashMap<>();
loadConfigMap.put(loadGenerator, loadConfig);
final Map<LoadGenerator, StepConfig> stepConfigMap = new HashMap<>();
stepConfigMap.put(loadGenerator, stepConfig);
final LoadController loadController = new BasicLoadController(
testStepName, driversMap, null, loadConfigMap, stepConfigMap
testStepName, driversMap, null, itemDataSizes, loadConfigMap, stepConfigMap
);
loadChain.add(loadController);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.emc.mongoose.run.scenario.step;

import com.emc.mongoose.common.api.SizeInBytes;
import com.emc.mongoose.common.exception.UserShootHisFootException;
import com.emc.mongoose.load.controller.BasicLoadController;
import com.emc.mongoose.model.data.ContentSource;
Expand Down Expand Up @@ -123,13 +124,15 @@ protected final void invoke() {

final Map<LoadGenerator, List<StorageDriver>> driversMap = new HashMap<>();
driversMap.put(loadGenerator, drivers);
final Map<LoadGenerator, SizeInBytes> itemDataSizes = new HashMap<>();
itemDataSizes.put(loadGenerator, dataConfig.getSize());
final Map<LoadGenerator, LoadConfig> loadConfigMap = new HashMap<>();
loadConfigMap.put(loadGenerator, loadConfig);
final Map<LoadGenerator, StepConfig> stepConfigMap = new HashMap<>();
stepConfigMap.put(loadGenerator, stepConfig);
try(
final LoadController controller = new BasicLoadController(
jobName, driversMap, null, loadConfigMap, stepConfigMap
jobName, driversMap, null, itemDataSizes, loadConfigMap, stepConfigMap
)
) {
final String itemOutputFile = itemConfig.getOutputConfig().getFile();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.emc.mongoose.run.scenario.step;

import com.emc.mongoose.common.api.SizeInBytes;
import com.emc.mongoose.common.exception.UserShootHisFootException;
import com.emc.mongoose.load.controller.BasicLoadController;
import com.emc.mongoose.model.data.ContentSource;
Expand Down Expand Up @@ -86,6 +87,7 @@ protected final void invoke() {
final Map<LoadGenerator, List<StorageDriver>> driverMap = new HashMap<>(loadGeneratorCount);
final Int2IntMap weightMap = weights == null ?
null : new Int2IntOpenHashMap(loadGeneratorCount);
final Map<LoadGenerator, SizeInBytes> itemDataSizes = new HashMap<>(loadGeneratorCount);
final Map<LoadGenerator, LoadConfig> loadConfigMap = new HashMap<>(loadGeneratorCount);
final Map<LoadGenerator, StepConfig> stepConfigMap = new HashMap<>(loadGeneratorCount);

Expand Down Expand Up @@ -136,6 +138,7 @@ protected final void invoke() {
if(weightMap != null) {
weightMap.put(loadGenerator.hashCode(), (int) weights.get(i));
}
itemDataSizes.put(loadGenerator, dataConfig.getSize());
loadConfigMap.put(loadGenerator, loadConfig);
stepConfigMap.put(loadGenerator, stepConfig);
}
Expand All @@ -147,7 +150,7 @@ protected final void invoke() {

try(
final LoadController controller = new BasicLoadController(
jobName, driverMap, weightMap, loadConfigMap, stepConfigMap
jobName, driverMap, weightMap, itemDataSizes, loadConfigMap, stepConfigMap
)
) {
final String itemOutputFile = localConfig.getItemConfig().getOutputConfig().getFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void shouldParseWithoutFireballsThrowing()
throws IOException {
final Config config = ConfigParser.loadDefaultConfig();
assertThat(config, notNullValue());
assertThat(config.getVersion(), equalTo("3.4.1", "version"));
assertThat(config.getVersion(), equalTo("3.4.2", "version"));
final NetConfig netConfig = config.getStorageConfig().getNetConfig();
assertThat(netConfig, notNullValue());
assertThat(netConfig.getTimeoutMilliSec(), equalTo(0, "storage.net.timeoutMilliSec"));
Expand Down Expand Up @@ -143,7 +143,7 @@ public void shouldParseWithoutFireballsThrowing()
assertThat(headers.containsKey(HttpConfig.KEY_HEADER_USER_AGENT),
equalTo(true, "storage.net.http.headers[User-Agent]"));
assertThat(headers.get(HttpConfig.KEY_HEADER_USER_AGENT),
equalTo("mongoose/3.4.1", "storage.net.http.headers[User-Agent]"));
equalTo("mongoose/3.4.2", "storage.net.http.headers[User-Agent]"));
assertThat(httpConfig.getNamespace(), nullValue("storage.net.http.namespace"));
assertThat(httpConfig.getVersioning(), equalTo(false, "storage.net.http.versioning"));
assertThat(
Expand Down

0 comments on commit c06700d

Please sign in to comment.