---
title: getRecentPerformanceSamples
description: >-
  Returns recent 60-second performance samples in reverse slot order. Each
  sample includes the number of transactions and slots recorded in that time
  window.
url: /docs/rpc/http/getrecentperformancesamples
type: reference
hideTableOfContents: true
---

Returns recent 60-second performance samples in reverse slot order. Each sample
includes the number of transactions and slots recorded in that time window.

<Callout type="info" title="Source">
  [`get_recent_performance_samples`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc.rs#L3607)
</Callout>

<APIMethod>

```jsonc !!request curl
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getRecentPerformanceSamples",
  "params": [
    // !hover number of samples
    2
  ]
}
```

```ts !!request title="Kit"
import { createSolanaRpc } from "@solana/kit";

const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);

// !hover number of samples
let limit = 2;

let performanceSamples = await rpc.getRecentPerformanceSamples(limit).send();

console.log(performanceSamples);
```

```ts !!request title="web3.js"
import { Connection, clusterApiUrl } from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

// !hover number of samples
let limit = 2;

let performanceSamples = await connection.getRecentPerformanceSamples(limit);

console.log(performanceSamples);
```

```rs !!request title="Rust"
use anyhow::Result;
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_commitment_config::CommitmentConfig;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RpcClient::new_with_commitment(
        String::from("https://api.devnet.solana.com"),
        CommitmentConfig::confirmed(),
    );

    // !hover number of samples
    let limit = 2;
    let performance_samples = client.get_recent_performance_samples(limit.into()).await?;

    println!("{:#?}", performance_samples);

    Ok(())
}
```

### !params

#### !! number of samples

!type usize  
!default 720

Number of samples to return (maximum 720)

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  // !hover(1:16) result
  "result": [
    {
      // !hover slot
      "slot": 348125,
      // !hover numTransactions
      "numTransactions": 126,
      // !hover numSlots
      "numSlots": 126,
      // !hover samplePeriodSecs
      "samplePeriodSecs": 60,
      // !hover numNonVoteTransactions
      "numNonVoteTransactions": 1
    },
    {
      "slot": 347999,
      "numTransactions": 126,
      "numSlots": 126,
      "samplePeriodSecs": 60,
      "numNonVoteTransactions": 1
    }
  ],
  "id": 1
}
```

!type array

An array of performance sample objects containing:

##### !! slot

!type u64

Slot at which the sample was taken.

##### !! numTransactions

!type u64

Number of transactions processed during the sample period

##### !! numSlots

!type u64

Number of slots completed during the sample period

##### !! samplePeriodSecs

!type u16

Number of seconds in a sample window

##### !! numNonVoteTransactions

!type u64 | null

Number of non-vote transactions processed during the sample period

<Callout type="info">
  `numNonVoteTransactions` is `null` for older performance samples that do not
  record it. To get a number of voting transactions, compute `numTransactions -
  numNonVoteTransactions` when this field is present.
</Callout>

</APIMethod>
