| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- import {
- DocBlock,
- DocSideBySide,
- CodeParams,
- Parameter,
- Field,
- Values,
- CodeSnippets,
- } from "../../../components/CodeDocBlock";
- <DocBlock>
- ## 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.
- <DocSideBySide>
- <CodeParams>
- ### Parameters:
- <Parameter name="limit" type={"usize"} optional={true}>
- number of samples to return (maximum 720)
- </Parameter>
- ### Result:
- An array of `RpcPerfSample<object>` with the following fields:
- - `slot: <u64>` - Slot in which sample was taken at
- - `numTransactions: <u64>` - Number of transactions processed during the sample period
- - `numSlots: <u64>` - Number of slots completed during the sample period
- - `samplePeriodSecs: <u16>` - Number of seconds in a sample window
- - `numNonVoteTransaction: <u64>` - Number of non-vote transactions processed during the
- sample period.
- :::info
- `numNonVoteTransaction` is present starting with v1.15.
- To get a number of voting transactions compute:<br />
- `numTransactions - numNonVoteTransaction`
- :::
- </CodeParams>
- <CodeSnippets>
- ### Code sample:
- ```bash
- curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
- {
- "jsonrpc":"2.0", "id":1,
- "method": "getRecentPerformanceSamples",
- "params": [4]}
- '
- ```
- ### Response:
- ```json
- {
- "jsonrpc": "2.0",
- "result": [
- {
- "numSlots": 126,
- "numTransactions": 126,
- "numNonVoteTransaction": 1,
- "samplePeriodSecs": 60,
- "slot": 348125
- },
- {
- "numSlots": 126,
- "numTransactions": 126,
- "numNonVoteTransaction": 1,
- "samplePeriodSecs": 60,
- "slot": 347999
- },
- {
- "numSlots": 125,
- "numTransactions": 125,
- "numNonVoteTransaction": 0,
- "samplePeriodSecs": 60,
- "slot": 347873
- },
- {
- "numSlots": 125,
- "numTransactions": 125,
- "numNonVoteTransaction": 0,
- "samplePeriodSecs": 60,
- "slot": 347748
- }
- ],
- "id": 1
- }
- ```
- </CodeSnippets>
- </DocSideBySide>
- </DocBlock>
|