Skip to content

Commit

Permalink
Merge pull request #27 from sysulq/feat/http
Browse files Browse the repository at this point in the history
feat: support http json to grpc
  • Loading branch information
sysulq authored Nov 20, 2024
2 parents 0581835 + b5ccd21 commit 47a8060
Show file tree
Hide file tree
Showing 45 changed files with 2,107 additions and 407 deletions.
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

0 comments on commit 47a8060

Please sign in to comment.