cpp-common
test_stats.cc
Go to the documentation of this file.
1 // -*- mode: c++; c-basic-offset: 2; -*-
2 
9 #include <cstdlib>
10 #include <iostream>
11 
12 #include "gtest/gtest.h"
13 #include "nvsl/stats.hh"
14 
15 TEST(stats, scalar) {
16  nvsl::StatsScalar testStat;
17 
18  testStat += 100;
19 
20  EXPECT_EQ(testStat.avg(), 100);
21 }
stats.hh
Class to collect stats, generate summary and latex code.
nvsl::StatsScalar::avg
double avg() const override
Get the average value per operation.
Definition: stats.hh:260
nvsl::StatsScalar
Represents a single stat with a name and a description.
Definition: stats.hh:229