Documentation index

getRecentPerformanceSamples

Returns a list of recent performance samples, taken every 60 seconds. Each sample includes the number of transactions and slots in that period. This data is invaluable for network performance monitoring, TPS (transactions per second) calculations, slot time analysis, and building dashboards that show real-time network throughput and health metrics.

Parameters

#TypeRequiredDescription
1usizeNoNumber of samples to return (maximum 720, default 720)

Response

Returns an array of performance sample objects:

FieldTypeDescription
[].slotu64Slot in which the sample was taken
[].numTransactionsu64Number of transactions processed in the sample period
[].numSlotsu64Number of slots completed in the sample period
[].samplePeriodSecsu16Duration of the sample window in seconds
[].numNonVoteTransactionsu64Number of non-vote transactions in the sample period

Code Examples

cURL

Terminal
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getRecentPerformanceSamples",
  "params": [
    5
  ]
}'

TypeScript

TypeScript
const response = await fetch("http://88.216.36.108:7999", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getRecentPerformanceSamples",
    params: [
      5
    ]
  }),
});
const { result } = await response.json();
result.forEach(s => console.log(`Slot ${s.slot}: ${s.numTransactions} txs in ${s.samplePeriodSecs}s`));

Python

Python
import requests

response = requests.post("http://88.216.36.108:7999", json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getRecentPerformanceSamples",
    "params": [
        5
    ]
})
result = response.json()["result"]
for s in result: print(f"Slot {s['slot']}: {s['numTransactions']} txs")

Rust

Rust
use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let res = client.post("http://88.216.36.108:7999")
        .json(&json!({
            "jsonrpc": "2.0",
            "id": 1,
            "method": "getRecentPerformanceSamples",
            "params": [
                5
            ]
        }))
        .send().await?
        .text().await?;
    println!("{}", res);
    Ok(())
}

Example Response

JSON
{
  "jsonrpc": "2.0",
  "result": [
    {
      "slot": 166974442,
      "numTransactions": 5432,
      "numSlots": 150,
      "samplePeriodSecs": 60,
      "numNonVoteTransactions": 1234
    }
  ],
  "id": 1
}