---
title: llarp::PeerStats

---

# llarp::PeerStats





## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[PeerStats](Classes/structllarp_1_1PeerStats.md#function-peerstats)**() |
| | **[PeerStats](Classes/structllarp_1_1PeerStats.md#function-peerstats)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & routerId) |
| [PeerStats](Classes/structllarp_1_1PeerStats.md) & | **[operator+=](Classes/structllarp_1_1PeerStats.md#function-operator+=)**(const [PeerStats](Classes/structllarp_1_1PeerStats.md) & other) |
| bool | **[operator==](Classes/structllarp_1_1PeerStats.md#function-operator==)**(const [PeerStats](Classes/structllarp_1_1PeerStats.md) & other) const |
| util::StatusObject | **[toJson](Classes/structllarp_1_1PeerStats.md#function-tojson)**() const |
| void | **[BEncode](Classes/structllarp_1_1PeerStats.md#function-bencode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const |
| void | **[BEncodeList](Classes/structllarp_1_1PeerStats.md#function-bencodelist)**(const std::vector< [PeerStats](Classes/structllarp_1_1PeerStats.md) > & statsList, [llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| [RouterID](Classes/structllarp_1_1RouterID.md) | **[routerId](Classes/structllarp_1_1PeerStats.md#variable-routerid)**  |
| int32_t | **[numConnectionAttempts](Classes/structllarp_1_1PeerStats.md#variable-numconnectionattempts)**  |
| int32_t | **[numConnectionSuccesses](Classes/structllarp_1_1PeerStats.md#variable-numconnectionsuccesses)**  |
| int32_t | **[numConnectionRejections](Classes/structllarp_1_1PeerStats.md#variable-numconnectionrejections)**  |
| int32_t | **[numConnectionTimeouts](Classes/structllarp_1_1PeerStats.md#variable-numconnectiontimeouts)**  |
| int32_t | **[numPathBuilds](Classes/structllarp_1_1PeerStats.md#variable-numpathbuilds)**  |
| int64_t | **[numPacketsAttempted](Classes/structllarp_1_1PeerStats.md#variable-numpacketsattempted)**  |
| int64_t | **[numPacketsSent](Classes/structllarp_1_1PeerStats.md#variable-numpacketssent)**  |
| int64_t | **[numPacketsDropped](Classes/structllarp_1_1PeerStats.md#variable-numpacketsdropped)**  |
| int64_t | **[numPacketsResent](Classes/structllarp_1_1PeerStats.md#variable-numpacketsresent)**  |
| int32_t | **[numDistinctRCsReceived](Classes/structllarp_1_1PeerStats.md#variable-numdistinctrcsreceived)**  |
| int32_t | **[numLateRCs](Classes/structllarp_1_1PeerStats.md#variable-numlatercs)**  |
| double | **[peakBandwidthBytesPerSec](Classes/structllarp_1_1PeerStats.md#variable-peakbandwidthbytespersec)**  |
| llarp_time_t | **[longestRCReceiveInterval](Classes/structllarp_1_1PeerStats.md#variable-longestrcreceiveinterval)**  |
| llarp_time_t | **[leastRCRemainingLifetime](Classes/structllarp_1_1PeerStats.md#variable-leastrcremaininglifetime)**  |
| llarp_time_t | **[lastRCUpdated](Classes/structllarp_1_1PeerStats.md#variable-lastrcupdated)**  |
| bool | **[stale](Classes/structllarp_1_1PeerStats.md#variable-stale)**  |

## Public Functions Documentation

### function PeerStats

```cpp
PeerStats()
```


### function PeerStats

```cpp
PeerStats(
    const RouterID & routerId
)
```


### function operator+=

```cpp
PeerStats & operator+=(
    const PeerStats & other
)
```


### function operator==

```cpp
bool operator==(
    const PeerStats & other
) const
```


### function toJson

```cpp
util::StatusObject toJson() const
```


### function BEncode

```cpp
void BEncode(
    llarp_buffer_t * buf
) const
```


### function BEncodeList

```cpp
static void BEncodeList(
    const std::vector< PeerStats > & statsList,
    llarp_buffer_t * buf
)
```


## Public Attributes Documentation

### variable routerId

```cpp
RouterID routerId;
```


### variable numConnectionAttempts

```cpp
int32_t numConnectionAttempts = 0;
```


### variable numConnectionSuccesses

```cpp
int32_t numConnectionSuccesses = 0;
```


### variable numConnectionRejections

```cpp
int32_t numConnectionRejections = 0;
```


### variable numConnectionTimeouts

```cpp
int32_t numConnectionTimeouts = 0;
```


### variable numPathBuilds

```cpp
int32_t numPathBuilds = 0;
```


### variable numPacketsAttempted

```cpp
int64_t numPacketsAttempted = 0;
```


### variable numPacketsSent

```cpp
int64_t numPacketsSent = 0;
```


### variable numPacketsDropped

```cpp
int64_t numPacketsDropped = 0;
```


### variable numPacketsResent

```cpp
int64_t numPacketsResent = 0;
```


### variable numDistinctRCsReceived

```cpp
int32_t numDistinctRCsReceived = 0;
```


### variable numLateRCs

```cpp
int32_t numLateRCs = 0;
```


### variable peakBandwidthBytesPerSec

```cpp
double peakBandwidthBytesPerSec = 0;
```


### variable longestRCReceiveInterval

```cpp
llarp_time_t longestRCReceiveInterval = 0ms;
```


### variable leastRCRemainingLifetime

```cpp
llarp_time_t leastRCRemainingLifetime = 0ms;
```


### variable lastRCUpdated

```cpp
llarp_time_t lastRCUpdated = 0ms;
```


### variable stale

```cpp
bool stale = true;
```


-------------------------------

Updated on 2023-01-09 at 19:27:44 +0000