Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support http json to grpc #27

Merged
merged 12 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@
"KOD_NAME": "constructsserver"
},
"program": "./example/gateway/constructsserver"
},
{
"name": "helloworld",
"type": "go",
"request": "launch",
"mode": "auto",
"cwd": "${workspaceFolder}",
"env": {
"KOD_NAME": "helloworld"
},
"program": "./example/gateway/helloworld"
}
],
"compounds": [
Expand All @@ -45,6 +56,7 @@
"configurations": [
"constructsserver",
"optionsserver",
"helloworld",
"gateway"
],
"stopAll": true
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ Percentage of the requests served within a certain time (ms)
100% 102 (longest request)
```

## Call Graph

![callgraph](./assets/callgraph.png)

## Pyroscope

Visiting [http://localhost:4040](http://localhost:4040) will show the Pyroscope dashboard.
Expand Down
13 changes: 13 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tasks:
deps:
- constructsserver
- optionsserver
- helloworld
- gateway

gateway:
Expand All @@ -30,6 +31,10 @@ tasks:
cmds:
- go run ./example/gateway/optionsserver

helloworld:
cmds:
- go run ./example/gateway/helloworld

bench:
cmds:
- "ab -n 50000 -kc 500 -T 'application/json' -p test/post1.json http://localhost:8080/query"
Expand All @@ -38,10 +43,18 @@ tasks:
cmds:
- "ab -n 50000 -kc 500 -T 'application/json' -p test/post2.json http://localhost:8080/query"

bench3:
cmds:
- "ab -n 50000 -kc 500 'http://localhost:9090/say/bob'"

curl:
cmds:
- "curl 'http://localhost:8080/playground' -H 'Content-Type: application/json' --data-binary @test/post2.json -v"

curlhttp:
cmds:
- "curl 'http://localhost:9090/say/bob'"

test:
cmds:
- go test -race -cover -coverprofile=coverage.out -covermode=atomic ./...
Expand Down
6 changes: 6 additions & 0 deletions api/buf.lock
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 553fd4b4b3a640be9b69a3fa0c17b383
digest: shake256:e30e3247f84b7ff9d09941ce391eb4b6f04734e1e5fae796bfc471f167e6f90813630cc39397ee46b8bc0ea7d6935c416d15c219cc5732d9778cbfdf73a1ed6e
3 changes: 3 additions & 0 deletions api/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
version: v1

deps:
- buf.build/googleapis/googleapis

lint:
rpc_allow_same_request_response: false
rpc_allow_google_protobuf_empty_requests: true
Expand Down
Loading