mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-06 13:26:23 +00:00
This pull request adds the loadtime tool. This tool leverages the tm-load-test framework. Using the framework means that the only real logic that needs to be written is the logic for Tx generation. The framework does the rest. The tool writes a set of metadata into the transaction, including the current transaction rate, number of connections, specified size of the transaction, and the current time.
24 lines
453 B
Go
24 lines
453 B
Go
package payload
|
|
|
|
import (
|
|
"math"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
|
)
|
|
|
|
func CalculateUnpaddedSizeBytes() (int, error) {
|
|
p := &Payload{
|
|
Time: timestamppb.Now(),
|
|
Connections: math.MaxUint64,
|
|
Rate: math.MaxUint64,
|
|
Size: math.MaxUint64,
|
|
Padding: make([]byte, 1),
|
|
}
|
|
b, err := proto.Marshal(p)
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
return len(b), nil
|
|
}
|