docs: getRecentPerformanceSamples json rpc (#12627)
This commit is contained in:
parent
e03a64ae1b
commit
b2fc7f7caa
|
@ -42,6 +42,7 @@ To interact with a Solana node inside a JavaScript application, use the [solana-
|
||||||
- [getMultipleAccounts](jsonrpc-api.md#getmultipleaccounts)
|
- [getMultipleAccounts](jsonrpc-api.md#getmultipleaccounts)
|
||||||
- [getProgramAccounts](jsonrpc-api.md#getprogramaccounts)
|
- [getProgramAccounts](jsonrpc-api.md#getprogramaccounts)
|
||||||
- [getRecentBlockhash](jsonrpc-api.md#getrecentblockhash)
|
- [getRecentBlockhash](jsonrpc-api.md#getrecentblockhash)
|
||||||
|
- [getRecentPerformanceSamples](jsonrpc-api.md#getrecentperformancesamples)
|
||||||
- [getSignatureStatuses](jsonrpc-api.md#getsignaturestatuses)
|
- [getSignatureStatuses](jsonrpc-api.md#getsignaturestatuses)
|
||||||
- [getSlot](jsonrpc-api.md#getslot)
|
- [getSlot](jsonrpc-api.md#getslot)
|
||||||
- [getSlotLeader](jsonrpc-api.md#getslotleader)
|
- [getSlotLeader](jsonrpc-api.md#getslotleader)
|
||||||
|
@ -976,6 +977,35 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "m
|
||||||
{"jsonrpc":"2.0","result":{"context":{"slot":1},"value":{"blockhash":"CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR","feeCalculator":{"lamportsPerSignature":5000}}},"id":1}
|
{"jsonrpc":"2.0","result":{"context":{"slot":1},"value":{"blockhash":"CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR","feeCalculator":{"lamportsPerSignature":5000}}},"id":1}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### getRecentPerformanceSamples
|
||||||
|
|
||||||
|
Returns a list of recent performance samples, in reverse slot order. Performance samples are taken every 60 seconds and
|
||||||
|
include the number of transactions and slots that occur in a given time window.
|
||||||
|
|
||||||
|
#### Parameters:
|
||||||
|
- `limit: <usize>` - (optional) number of samples to return (maximum 720)
|
||||||
|
|
||||||
|
#### Results:
|
||||||
|
|
||||||
|
An array of:
|
||||||
|
|
||||||
|
- `RpcPerfSample<object>`
|
||||||
|
- `slot: <u64>` - Slot in which sample was taken at
|
||||||
|
- `numTransactions: <u64>` - Number of transactions in sample
|
||||||
|
- `numSlots: <u64>` - Number of slots in sample
|
||||||
|
- `samplePeriodSecs: <u16>` - Number of seconds in a sample window
|
||||||
|
|
||||||
|
#### Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
// Request
|
||||||
|
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "method":"getRecentPerformanceSamples", "params": [4]}'
|
||||||
|
http://localhost:8899
|
||||||
|
|
||||||
|
// Result
|
||||||
|
{"jsonrpc":"2.0","result":[{"numSlots":126,"numTransactions":126,"samplePeriodSecs":60,"slot":348125},{"numSlots":126,"numTransactions":126,"samplePeriodSecs":60,"slot":347999},{"numSlots":125,"numTransactions":125,"samplePeriodSecs":60,"slot":347873},{"numSlots":125,"numTransactions":125,"samplePeriodSecs":60,"slot":347748}],"id":1}
|
||||||
|
```
|
||||||
|
|
||||||
### getSignatureStatuses
|
### getSignatureStatuses
|
||||||
|
|
||||||
Returns the statuses of a list of signatures. Unless the
|
Returns the statuses of a list of signatures. Unless the
|
||||||
|
|
Loading…
Reference in New Issue