summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-rw-r--r--dev/ns_gige.cc33
-rw-r--r--dev/ns_gige.hh4
-rw-r--r--dev/sinic.cc31
-rw-r--r--dev/sinic.hh4
4 files changed, 71 insertions, 1 deletions
diff --git a/dev/ns_gige.cc b/dev/ns_gige.cc
index aa47436f7..613677875 100644
--- a/dev/ns_gige.cc
+++ b/dev/ns_gige.cc
@@ -244,7 +244,6 @@ NSGigE::regStats()
.precision(0)
;
-
txBandwidth
.name(name() + ".txBandwidth")
.desc("Transmit Bandwidth (bits/s)")
@@ -259,6 +258,34 @@ NSGigE::regStats()
.prereq(rxBytes)
;
+ totBandwidth
+ .name(name() + ".totBandwidth")
+ .desc("Total Bandwidth (bits/s)")
+ .precision(0)
+ .prereq(totBytes)
+ ;
+
+ totPackets
+ .name(name() + ".totPackets")
+ .desc("Total Packets")
+ .precision(0)
+ .prereq(totBytes)
+ ;
+
+ totBytes
+ .name(name() + ".totBytes")
+ .desc("Total Bytes")
+ .precision(0)
+ .prereq(totBytes)
+ ;
+
+ totPacketRate
+ .name(name() + ".totPPS")
+ .desc("Total Tranmission Rate (packets/s)")
+ .precision(0)
+ .prereq(totBytes)
+ ;
+
txPacketRate
.name(name() + ".txPPS")
.desc("Packet Tranmission Rate (packets/s)")
@@ -449,6 +476,10 @@ NSGigE::regStats()
txBandwidth = txBytes * Stats::constant(8) / simSeconds;
rxBandwidth = rxBytes * Stats::constant(8) / simSeconds;
+ totBandwidth = txBandwidth + rxBandwidth;
+ totBytes = txBytes + rxBytes;
+ totPackets = txPackets + rxPackets;
+
txPacketRate = txPackets / simSeconds;
rxPacketRate = rxPackets / simSeconds;
}
diff --git a/dev/ns_gige.hh b/dev/ns_gige.hh
index bc7a87373..50472d5bc 100644
--- a/dev/ns_gige.hh
+++ b/dev/ns_gige.hh
@@ -379,6 +379,10 @@ class NSGigE : public PciDev
Stats::Scalar<> descDmaWrites;
Stats::Scalar<> descDmaRdBytes;
Stats::Scalar<> descDmaWrBytes;
+ Stats::Formula totBandwidth;
+ Stats::Formula totPackets;
+ Stats::Formula totBytes;
+ Stats::Formula totPacketRate;
Stats::Formula txBandwidth;
Stats::Formula rxBandwidth;
Stats::Formula txPacketRate;
diff --git a/dev/sinic.cc b/dev/sinic.cc
index 56782b589..fa4cd570f 100644
--- a/dev/sinic.cc
+++ b/dev/sinic.cc
@@ -191,6 +191,34 @@ Device::regStats()
.prereq(rxBytes)
;
+ totBandwidth
+ .name(name() + ".totBandwidth")
+ .desc("Total Bandwidth (bits/s)")
+ .precision(0)
+ .prereq(totBytes)
+ ;
+
+ totPackets
+ .name(name() + ".totPackets")
+ .desc("Total Packets")
+ .precision(0)
+ .prereq(totBytes)
+ ;
+
+ totBytes
+ .name(name() + ".totBytes")
+ .desc("Total Bytes")
+ .precision(0)
+ .prereq(totBytes)
+ ;
+
+ totPacketRate
+ .name(name() + ".totPPS")
+ .desc("Total Tranmission Rate (packets/s)")
+ .precision(0)
+ .prereq(totBytes)
+ ;
+
txBytes
.name(name() + ".txBytes")
.desc("Bytes Transmitted")
@@ -258,6 +286,9 @@ Device::regStats()
txBandwidth = txBytes * Stats::constant(8) / simSeconds;
rxBandwidth = rxBytes * Stats::constant(8) / simSeconds;
+ totBandwidth = txBandwidth + rxBandwidth;
+ totBytes = txBytes + rxBytes;
+ totPackets = txPackets + rxPackets;
txPacketRate = txPackets / simSeconds;
rxPacketRate = rxPackets / simSeconds;
}
diff --git a/dev/sinic.hh b/dev/sinic.hh
index ef515ffad..25a433d5d 100644
--- a/dev/sinic.hh
+++ b/dev/sinic.hh
@@ -262,6 +262,10 @@ class Device : public Base
Stats::Scalar<> txBytes;
Stats::Formula txBandwidth;
+ Stats::Formula totBandwidth;
+ Stats::Formula totPackets;
+ Stats::Formula totBytes;
+ Stats::Formula totPacketRate;
Stats::Scalar<> txPackets;
Stats::Formula txPacketRate;
Stats::Scalar<> txIpPackets;