[#114] datagen: Remove calcHash parameter in GenPayload()
Hash calculation is now done on-demand with a method call. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
4544ec616b
commit
d8af19cc83
9 changed files with 9 additions and 9 deletions
|
@ -88,7 +88,7 @@ func (g *Generator) fillBuffer() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Generator) GenPayload(calcHash bool) Payload {
|
func (g *Generator) GenPayload() Payload {
|
||||||
if g.streaming {
|
if g.streaming {
|
||||||
return NewStreamPayload(g.size, g.seed.Add(1), g.typ)
|
return NewStreamPayload(g.size, g.seed.Add(1), g.typ)
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ export function obj_write() {
|
||||||
};
|
};
|
||||||
const container = container_list[Math.floor(Math.random() * container_list.length)];
|
const container = container_list[Math.floor(Math.random() * container_list.length)];
|
||||||
|
|
||||||
const payload = generator.genPayload(registry_enabled);
|
const payload = generator.genPayload();
|
||||||
const resp = grpc_client.put(container, headers, payload, write_grpc_chunk_size);
|
const resp = grpc_client.put(container, headers, payload, write_grpc_chunk_size);
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
log.withField("cid", container).error(resp.error);
|
log.withField("cid", container).error(resp.error);
|
||||||
|
|
|
@ -174,7 +174,7 @@ export function obj_write() {
|
||||||
};
|
};
|
||||||
const container = container_list[Math.floor(Math.random() * container_list.length)];
|
const container = container_list[Math.floor(Math.random() * container_list.length)];
|
||||||
|
|
||||||
const payload = generator.genPayload(registry_enabled);
|
const payload = generator.genPayload();
|
||||||
const resp = grpc_client.put(container, headers, payload, write_grpc_chunk_size);
|
const resp = grpc_client.put(container, headers, payload, write_grpc_chunk_size);
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
log.withField("cid", container).error(resp.error);
|
log.withField("cid", container).error(resp.error);
|
||||||
|
|
|
@ -97,7 +97,7 @@ export function obj_write() {
|
||||||
|
|
||||||
const container = container_list[Math.floor(Math.random() * container_list.length)];
|
const container = container_list[Math.floor(Math.random() * container_list.length)];
|
||||||
|
|
||||||
const payload = generator.genPayload(registry_enabled);
|
const payload = generator.genPayload();
|
||||||
const data = {
|
const data = {
|
||||||
field: uuidv4(),
|
field: uuidv4(),
|
||||||
// Because we use `file` wrapping and it is not straightforward to use streams here,
|
// Because we use `file` wrapping and it is not straightforward to use streams here,
|
||||||
|
|
|
@ -128,7 +128,7 @@ export function obj_write() {
|
||||||
};
|
};
|
||||||
const container = container_list[Math.floor(Math.random() * container_list.length)];
|
const container = container_list[Math.floor(Math.random() * container_list.length)];
|
||||||
|
|
||||||
const payload = generator.genPayload(registry_enabled);
|
const payload = generator.genPayload();
|
||||||
const resp = local_client.put(container, headers, payload);
|
const resp = local_client.put(container, headers, payload);
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
if (resp.abort) {
|
if (resp.abort) {
|
||||||
|
|
|
@ -145,7 +145,7 @@ export function obj_write() {
|
||||||
const key = __ENV.OBJ_NAME || uuidv4();
|
const key = __ENV.OBJ_NAME || uuidv4();
|
||||||
const bucket = bucket_list[Math.floor(Math.random() * bucket_list.length)];
|
const bucket = bucket_list[Math.floor(Math.random() * bucket_list.length)];
|
||||||
|
|
||||||
const payload = generator.genPayload(registry_enabled);
|
const payload = generator.genPayload();
|
||||||
const resp = s3_client.put(bucket, key, payload);
|
const resp = s3_client.put(bucket, key, payload);
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
log.withFields({bucket: bucket, key: key}).error(resp.error);
|
log.withFields({bucket: bucket, key: key}).error(resp.error);
|
||||||
|
|
|
@ -172,7 +172,7 @@ export function obj_write() {
|
||||||
const key = __ENV.OBJ_NAME || uuidv4();
|
const key = __ENV.OBJ_NAME || uuidv4();
|
||||||
const bucket = bucket_list[Math.floor(Math.random() * bucket_list.length)];
|
const bucket = bucket_list[Math.floor(Math.random() * bucket_list.length)];
|
||||||
|
|
||||||
const payload = generator.genPayload(registry_enabled);
|
const payload = generator.genPayload();
|
||||||
const resp = s3_client.put(bucket, key, payload);
|
const resp = s3_client.put(bucket, key, payload);
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
log.withFields({bucket: bucket, key: key}).error(resp.error);
|
log.withFields({bucket: bucket, key: key}).error(resp.error);
|
||||||
|
|
|
@ -92,7 +92,7 @@ export function obj_write_multipart() {
|
||||||
const key = __ENV.OBJ_NAME || uuidv4();
|
const key = __ENV.OBJ_NAME || uuidv4();
|
||||||
const bucket = bucket_list[Math.floor(Math.random() * bucket_list.length)];
|
const bucket = bucket_list[Math.floor(Math.random() * bucket_list.length)];
|
||||||
|
|
||||||
const payload = generator.genPayload(registry_enabled);
|
const payload = generator.genPayload();
|
||||||
const resp = s3_client.multipart(bucket, key, write_multipart_part_size, write_multipart_vu_count, payload);
|
const resp = s3_client.multipart(bucket, key, write_multipart_part_size, write_multipart_vu_count, payload);
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
log.withFields({bucket: bucket, key: key}).error(resp.error);
|
log.withFields({bucket: bucket, key: key}).error(resp.error);
|
||||||
|
|
|
@ -124,7 +124,7 @@ export function obj_write() {
|
||||||
const key = __ENV.OBJ_NAME || uuidv4();
|
const key = __ENV.OBJ_NAME || uuidv4();
|
||||||
const bucket = bucket_list[Math.floor(Math.random() * bucket_list.length)];
|
const bucket = bucket_list[Math.floor(Math.random() * bucket_list.length)];
|
||||||
|
|
||||||
const payload = generator.genPayload(registry_enabled);
|
const payload = generator.genPayload();
|
||||||
const resp = s3_client.put(bucket, key, payload);
|
const resp = s3_client.put(bucket, key, payload);
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
if (resp.abort) {
|
if (resp.abort) {
|
||||||
|
|
Loading…
Reference in a new issue