blob: 8b2433efcbe3d1aa1b5eae8e3c7ad446d20c7889 [file] [log] [blame]
Alexander Afanasyev0845c092012-07-13 17:45:33 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
21#ifndef LOAD_STATS_H
22#define LOAD_STATS_H
23
24#include "ns3/nstime.h"
25#include <boost/tuple/tuple.hpp>
26
27namespace ndnSIM
28{
29
30class LoadStats
31{
32public:
33 typedef boost::tuple<double, double, double> stats_tuple;
34
35 LoadStats ();
36
37 void
38 Step ();
39
40 // void
41 // Increment (uint32_t amount);
42
43 LoadStats &
44 operator ++ (int);
45
46 // uint32_t
47 // GetCounter () const;
48
49 LoadStats &
50 operator += (const LoadStats &stats);
51
52 stats_tuple
53 GetStats () const;
54
55 bool
56 IsEmpty () const;
57
58private:
59 uint32_t counter_;
60
61 double avg1_;
62 double avg5_;
63 double avg15_;
64};
65
66std::ostream &
67operator << (std::ostream &os, const LoadStats &stats);
68
69} // ndnSIM
70
71#endif // LOAD_STATS_H