---
name: "ACE_Throughput_Stats"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Throughput_Stats"
---

# ACE\_Throughput\_Stats(3)

A simple class to make throughput and latency analysis.

## NAME

ACE\_Throughput\_Stats -  A simple class to make throughput and latency analysis.

## SYNOPSIS

```
#include <ace/Stats.h>
class ACE_Throughput_Stats
{
  public:
    ACE_Throughput_Stats (void);
    void sample (ACE_UINT64 throughput, ACE_UINT64 latency);
    void accumulate (const ACE_Throughput_Stats &throughput);
    void dump_results (
        const ASYS_TCHAR* msg,
        ACE_UINT32 scale_factor
        );
  private:
    ACE_UINT64 samples_count_;
    ACE_UINT64 latency_min_;
    ACE_UINT32 latency_min_at_;
    ACE_UINT64 latency_max_;
    ACE_UINT32 latency_max_at_;
    ACE_UINT64 latency_sum_;
    ACE_UINT64 latency_sum2_;
    ACE_UINT64 throughput_last_;
    ACE_UINT64 throughput_sum_x_;
    ACE_UINT64 throughput_sum_x2_;
    ACE_UINT64 throughput_sum_y_;
    ACE_UINT64 throughput_sum_y2_;
    ACE_UINT64 throughput_sum_xy_;
};
```

## DESCRIPTION

Keep the relevant information to perform throughput and latency analysis, including: 1) Minimum, Average and Maximum latency 2) Jitter for the latency 3) Linear regression for throughput 4) Accumulate results from several samples to obtain aggregated\
    results, across several threads or experiments.

## PUBLIC MEMBERS

```
ACE_Throughput_Stats (void);
```

Default constructor.

```
void sample (ACE_UINT64 throughput, ACE_UINT64 latency);
```

Store one sample

```
void accumulate (const ACE_Throughput_Stats &throughput);
```

Update the values to reflect the stats in throughput

```
void dump_results (const ASYS_TCHAR* msg, ACE_UINT32 scale_factor);
```

Print down the stats

## PRIVATE MEMBERS

```
ACE_UINT64 samples_count_;
```

The number of samples

```
ACE_UINT64 latency_min_;
```

```
ACE_UINT32 latency_min_at_;
```

```
ACE_UINT64 latency_max_;
```

```
ACE_UINT32 latency_max_at_;
```

```
ACE_UINT64 latency_sum_;
```

```
ACE_UINT64 latency_sum2_;
```

The stadigraphs for latency computation

```
ACE_UINT64 throughput_last_;
```

```
ACE_UINT64 throughput_sum_x_;
```

```
ACE_UINT64 throughput_sum_x2_;
```

```
ACE_UINT64 throughput_sum_y_;
```

```
ACE_UINT64 throughput_sum_y2_;
```

```
ACE_UINT64 throughput_sum_xy_;
```

The stadigraphs for throughput computation

## AUTHORS

David L. Levine

## LIBRARY

ace
