command-line:
$ h2load http://localhost:50051/helloworld.Greeter/SayHello \ -d grpc-upload \ -H 'te: trailers' -H 'content-type: application/grpc' -n1000000 -c100 -m100
Create grpc-upload file using following python script:
$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.7.0 |
$ curl -C - https://download.java.net/java/ga/jdk11/openjdk-11_osx-x64_bin.tar.gz -O openjdk-11_osx-x64_bin.tar.gz | |
$ tar xf openjdk-11_osx-x64_bin.tar.gz | |
$ sudo mv jdk-11.jdk /Library/Java/JavaVirtualMachines/ | |
$ java -version | |
openjdk version "11" 2018-09-25 | |
OpenJDK Runtime Environment 18.9 (build 11+28) | |
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode) |
# Set the retries to Integer.MAX_VALUE to ensure that transient failures | |
# will not result in data loss. | |
ksql.streams.producer.retries=2147483647 | |
# Set the batch expiry to Long.MAX_VALUE to ensure that queries will not | |
# terminate if the underlying Kafka cluster is unavailable for a period of | |
# time. | |
ksql.streams.producer.confluent.batch.expiry.ms=9223372036854775807 | |
# Allows more frequent retries of requests when there are failures, |
command-line:
$ h2load http://localhost:50051/helloworld.Greeter/SayHello \ -d grpc-upload \ -H 'te: trailers' -H 'content-type: application/grpc' -n1000000 -c100 -m100
Create grpc-upload file using following python script:
package main | |
import "encoding/json" | |
// jsonText comes from http://json.org/example.html | |
var jsonText = []byte(` | |
{ | |
... // 此处省略, 同上 | |
}`) |
package main | |
import "encoding/json" | |
// jsonText comes from http://json.org/example.html | |
var jsonText = []byte(` | |
{ | |
"glossary":{ | |
"title":"example glossary", | |
"GlossDiv":{ |
package main | |
import ( | |
"log" | |
"time" | |
"golang.org/x/sys/unix" | |
) | |
func main() { |
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
// Fetcher ... | |
type Fetcher interface { | |
// Fetch returns the body of URL and |
/* Exercise: Loops and Functions #43 */ | |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(2.) |