getRecentPerformanceSamples — Solana JSON-RPC
Returns a list of recent cluster performance samples, in reverse slot order.
https://triport.io/sol- Network
- Solana
- Scope
- sol_read_rpc
- Auth
- x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
- Rate limit
- free+ — 20 / 60 / 200 / 600 RPS sustained · short burst 40 / 120 / 400 / 1200 (free / basic / pro / business); Burst capacity
Endpoint and plans: Solana RPC endpoint.
getRecentPerformanceSamples returns a list of recent performance samples taken
across the cluster. Each sample summarizes the number of transactions and slots
that occurred over a fixed samplePeriodSecs window (typically 60 seconds), and
is taken roughly once per sample period.
This is the canonical way to estimate recent throughput — transactions per
second (TPS) and non-vote TPS — without polling individual slots. Divide a
sample's numTransactions (or numNonVoteTransactions) by samplePeriodSecs
to get the average TPS for that window.
Samples are returned newest-first, ordered by slot descending. Use the
optional limit parameter to request fewer than the maximum number of samples.
Parameters
JSON-RPC params is a positional array: [limit?].
limitintegeroptionallimit as the node's bound rather than a product limit. Omit it to get the node's default.Response
Response fields
result is an array of PerformanceSample objects, ordered by slot
descending. Each element has the following fields:
| Field | Type | Description |
|---|---|---|
slot | integer | The slot in which the sample was taken. |
numTransactions | integer | Total number of transactions processed during the sample period. |
numNonVoteTransactions | integer | Number of non-vote transactions processed during the sample period. |
numSlots | integer | Number of slots completed during the sample period. |
samplePeriodSecs | integer | Length of the sample window, in seconds. |
Errors
Errors are returned in the standard JSON-RPC error envelope. See the shared errors reference for the full envelope shape and shared codes.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | limit is not an integer, or is outside the range the serving node accepts. The upper bound belongs to the node, so read it from the error message rather than hard-coding a number. |
401 | Unauthorized | Missing or invalid Authorization: Bearer key. |
429 | Rate limited | More than your tier's RPS for sol_read_rpc (20 / 60 / 200 / 600). |
Examples
JavaScript (fetch)
const res = await fetch("https://triport.io/sol", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getRecentPerformanceSamples",
params: [4],
}),
});
const { result } = await res.json();
const latest = result[0];
const tps = latest.numTransactions / latest.samplePeriodSecs;
console.log(`Recent TPS at slot ${latest.slot}: ${tps.toFixed(0)}`);Notes
- Ordering: samples are returned newest-first (
slotdescending), soresult[0]is always the most recent window. - Computing TPS: divide
numTransactionsbysamplePeriodSecsfor total TPS, or usenumNonVoteTransactionsto exclude consensus vote traffic — the latter is usually the more meaningful measure of user activity. limitis a maximum: the cluster retains a bounded history, so fewer than the requested number of samples may be returned if not enough have accumulated.- Related methods: use
getSlotto read the current slot andgetRecentPrioritizationFeesto estimate the priority fee needed to land a transaction during periods of high throughput.