mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 04:55:18 +00:00
* test: add the loadtime tool (#9342) 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. * lint
20 lines
410 B
Go
20 lines
410 B
Go
package payload_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/tendermint/tendermint/test/loadtime/payload"
|
|
)
|
|
|
|
const payloadSizeTarget = 1024 // 1kb
|
|
|
|
func TestCalculateSize(t *testing.T) {
|
|
s, err := payload.CalculateUnpaddedSizeBytes()
|
|
if err != nil {
|
|
t.Fatalf("calculating unpadded size %s", err)
|
|
}
|
|
if s > payloadSizeTarget {
|
|
t.Fatalf("unpadded payload size %d exceeds target %d", s, payloadSizeTarget)
|
|
}
|
|
}
|