add separated runs by UUID

This commit is contained in:
William Banfield
2022-09-02 17:24:20 -04:00
parent 8655080a0f
commit 80c8b86553
10 changed files with 183 additions and 78 deletions
+15 -3
View File
@@ -21,6 +21,9 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Payload is the structure of the loadtime transaction. Proto has a compact
// encoded representation, making it ideal for the loadtime usecase which aims to
// keep the generated transactions small.
type Payload struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -30,7 +33,8 @@ type Payload struct {
Rate uint64 `protobuf:"varint,2,opt,name=rate,proto3" json:"rate,omitempty"`
Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
Time *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=time,proto3" json:"time,omitempty"`
Padding []byte `protobuf:"bytes,5,opt,name=padding,proto3" json:"padding,omitempty"`
Id []byte `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
Padding []byte `protobuf:"bytes,6,opt,name=padding,proto3" json:"padding,omitempty"`
}
func (x *Payload) Reset() {
@@ -93,6 +97,13 @@ func (x *Payload) GetTime() *timestamppb.Timestamp {
return nil
}
func (x *Payload) GetId() []byte {
if x != nil {
return x.Id
}
return nil
}
func (x *Payload) GetPadding() []byte {
if x != nil {
return x.Padding
@@ -107,7 +118,7 @@ var file_payload_payload_proto_rawDesc = []byte{
0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6c, 0x6f, 0x61, 0x64, 0x74, 0x69, 0x6d,
0x65, 0x2e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73,
0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x01, 0x0a, 0x07, 0x50,
0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x01, 0x0a, 0x07, 0x50,
0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x63, 0x6f, 0x6e,
0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x74, 0x65,
@@ -116,7 +127,8 @@ var file_payload_payload_proto_rawDesc = []byte{
0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64,
0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d,
0x69, 0x6e, 0x74, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74,
+6 -5
View File
@@ -9,9 +9,10 @@ import "google/protobuf/timestamp.proto";
// encoded representation, making it ideal for the loadtime usecase which aims to
// keep the generated transactions small.
message Payload {
uint64 connections = 1;
uint64 rate = 2;
uint64 size = 3;
google.protobuf.Timestamp time = 4;
bytes padding = 5;
uint64 connections = 1;
uint64 rate = 2;
uint64 size = 3;
google.protobuf.Timestamp time = 4;
bytes id = 5;
bytes padding = 6;
}
+7
View File
@@ -1,8 +1,10 @@
package payload_test
import (
"bytes"
"testing"
"github.com/google/uuid"
"github.com/tendermint/tendermint/test/loadtime/payload"
)
@@ -23,10 +25,12 @@ func TestRoundTrip(t *testing.T) {
testConns = 512
testRate = 4
)
testId := [16]byte(uuid.New())
b, err := payload.NewBytes(&payload.Payload{
Size: payloadSizeTarget,
Connections: testConns,
Rate: testRate,
Id: testId[:],
})
if err != nil {
t.Fatalf("generating payload %s", err)
@@ -47,4 +51,7 @@ func TestRoundTrip(t *testing.T) {
if p.Rate != testRate {
t.Fatalf("payload rate value %d does not match expected %d", p.Rate, testRate)
}
if !bytes.Equal(p.Id, testId[:]) {
t.Fatalf("payload Id value %d does not match expected %d", p.Id, testId)
}
}