wasm: update benchmark to use `url` instead of `path` (#3001)
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com> Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com> Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
This commit is contained in:
parent
d067c13350
commit
22a695c745
|
@ -28,19 +28,19 @@ func BenchmarkNative(b *testing.B) {
|
|||
}
|
||||
|
||||
func BenchmarkTinygo(b *testing.B) {
|
||||
path := "./internal/e2e-guests/rewrite/main.wasm"
|
||||
path := "file://internal/e2e-guests/rewrite/main.wasm"
|
||||
benchmarkMiddleware(b, path)
|
||||
}
|
||||
|
||||
// BenchmarkWat gives baseline performance for the same handler by
|
||||
// writing it directly in WebAssembly Text Format.
|
||||
func BenchmarkWat(b *testing.B) {
|
||||
path := "./internal/testdata/rewrite.wasm"
|
||||
benchmarkMiddleware(b, path)
|
||||
url := "file://internal/testdata/rewrite.wasm"
|
||||
benchmarkMiddleware(b, url)
|
||||
}
|
||||
|
||||
func benchmarkMiddleware(b *testing.B, path string) {
|
||||
md := metadata.Base{Properties: map[string]string{"path": path}}
|
||||
md := metadata.Base{Properties: map[string]string{"url": path}}
|
||||
|
||||
l := logger.NewLogger(b.Name())
|
||||
l.SetOutput(io.Discard)
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
"github.com/dapr/components-contrib/state/query"
|
||||
)
|
||||
|
||||
// GetRequest is the object describing a state fetch request.
|
||||
// GetRequest is the object describing a state "fetch" request.
|
||||
type GetRequest struct {
|
||||
Key string `json:"key"`
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
|
|
Loading…
Reference in New Issue