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

rest api: /debug/settings/pprof admin endpoint for debugging #6018

Merged
merged 2 commits into from
Jun 7, 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
64 changes: 64 additions & 0 deletions daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,44 @@
}
}
},
"/debug/settings/pprof": {
"get": {
"description": "Retrieves the current settings for blocking and mutex profiles",
"tags": [
"private"
],
"produces": [
"application/json"
],
"schemes": [
"http"
],
"operationId": "GetDebugSettingsProf",
"responses": {
"200": {
"$ref": "#/responses/DebugSettingsProfResponse"
}
}
},
"put": {
"description": "Enables blocking and mutex profiles, and returns the old settings",
"tags": [
"private"
],
"produces": [
"application/json"
],
"schemes": [
"http"
],
"operationId": "PutDebugSettingsProf",
"responses": {
"200": {
"$ref": "#/responses/DebugSettingsProfResponse"
}
}
}
},
"/v2/accounts/{address}": {
"get": {
"description": "Given a specific account public key, this call returns the accounts status, balance and spendable amounts",
Expand Down Expand Up @@ -4053,6 +4091,26 @@
}
}
},
"DebugSettingsProf": {
"description": "algod mutex and blocking profiling state.",
"type": "object",
"title": "algod mutex and blocking profiling state.",
"tags": [
"private"
],
"properties": {
"block-rate": {
"description": "The rate of blocking events. The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked. To turn off profiling entirely, pass rate 0.",
"example": 1000,
"type": "integer"
},
"mutex-rate": {
"description": "The rate of mutex events. On average 1/rate events are reported. To turn off profiling entirely, pass rate 0",
"example": 1000,
"type": "integer"
}
}
},
"BuildVersion": {
"tags": [
"common"
Expand Down Expand Up @@ -5500,6 +5558,12 @@
"schema": {
"$ref": "#/definitions/Version"
}
},
"DebugSettingsProfResponse": {
"description": "DebugPprof is the response to the /debug/extra/pprof endpoint",
"schema": {
"$ref": "#/definitions/DebugSettingsProf"
}
}
},
"securityDefinitions": {
Expand Down
67 changes: 67 additions & 0 deletions daemon/algod/api/algod.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,16 @@
},
"description": "Teal compile Result"
},
"DebugSettingsProfResponse": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DebugSettingsProf"
}
}
},
"description": "DebugPprof is the response to the /debug/extra/pprof endpoint"
},
"DisassembleResponse": {
"content": {
"application/json": {
Expand Down Expand Up @@ -1790,6 +1800,23 @@
"title": "BuildVersion contains the current algod build version information.",
"type": "object"
},
"DebugSettingsProf": {
"description": "algod mutex and blocking profiling state.",
"properties": {
"block-rate": {
"description": "The rate of blocking events. The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked. To turn off profiling entirely, pass rate 0.",
"example": 1000,
"type": "integer"
},
"mutex-rate": {
"description": "The rate of mutex events. On average 1/rate events are reported. To turn off profiling entirely, pass rate 0",
"example": 1000,
"type": "integer"
}
},
"title": "algod mutex and blocking profiling state.",
"type": "object"
},
"DryrunRequest": {
"description": "Request data type for dryrun endpoint. Given the Transactions and simulated ledger state upload, run TEAL scripts and return debugging information.",
"properties": {
Expand Down Expand Up @@ -2748,6 +2775,46 @@
},
"openapi": "3.0.1",
"paths": {
"/debug/settings/pprof": {
"get": {
"description": "Retrieves the current settings for blocking and mutex profiles",
"operationId": "GetDebugSettingsProf",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DebugSettingsProf"
}
}
},
"description": "DebugPprof is the response to the /debug/extra/pprof endpoint"
}
},
"tags": [
"private"
]
},
"put": {
"description": "Enables blocking and mutex profiles, and returns the old settings",
"operationId": "PutDebugSettingsProf",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DebugSettingsProf"
}
}
},
"description": "DebugPprof is the response to the /debug/extra/pprof endpoint"
}
},
"tags": [
"private"
]
}
},
"/genesis": {
"get": {
"description": "Returns the entire genesis file in json.",
Expand Down
2 changes: 0 additions & 2 deletions daemon/algod/api/server/common/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ func VersionsHandler(ctx lib.ReqContext, context echo.Context) {
},
}
json.NewEncoder(w).Encode(response.Body)

return
}

// CORS
Expand Down
Loading
Loading