summaryrefslogtreecommitdiff
path: root/src/mongo/db/stats
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2019-01-04 12:19:37 -0500
committerBilly Donahue <billy.donahue@mongodb.com>2019-01-07 12:08:23 -0500
commit11bb071e91461b1f8e40b9b15ddf3b9e1a2d23d1 (patch)
tree7037865f9bf4445fb3295ca7ce72f4182f012554 /src/mongo/db/stats
parent6a0a21214dd96663c899cb8f2562d6121351ed3c (diff)
downloadmongo-11bb071e91461b1f8e40b9b15ddf3b9e1a2d23d1.tar.gz
SERVER-36644 remove AtomicWord typedefs
Diffstat (limited to 'src/mongo/db/stats')
-rw-r--r--src/mongo/db/stats/counters.cpp4
-rw-r--r--src/mongo/db/stats/counters.h38
-rw-r--r--src/mongo/db/stats/timer_stats.h4
3 files changed, 23 insertions, 23 deletions
diff --git a/src/mongo/db/stats/counters.cpp b/src/mongo/db/stats/counters.cpp
index 0355fa8787b..406385b28c9 100644
--- a/src/mongo/db/stats/counters.cpp
+++ b/src/mongo/db/stats/counters.cpp
@@ -68,8 +68,8 @@ void OpCounters::gotOp(int op, bool isCommand) {
}
}
-void OpCounters::_checkWrap(CacheAligned<AtomicInt64> OpCounters::*counter, int n) {
- static constexpr auto maxCount = AtomicInt64::WordType{1} << 60;
+void OpCounters::_checkWrap(CacheAligned<AtomicWord<long long>> OpCounters::*counter, int n) {
+ static constexpr auto maxCount = 1LL << 60;
auto oldValue = (this->*counter).fetchAndAddRelaxed(n);
if (oldValue > maxCount) {
_insert.store(0);
diff --git a/src/mongo/db/stats/counters.h b/src/mongo/db/stats/counters.h
index 4d6a057e427..699dbb43b12 100644
--- a/src/mongo/db/stats/counters.h
+++ b/src/mongo/db/stats/counters.h
@@ -76,35 +76,35 @@ public:
BSONObj getObj() const;
// thse are used by snmp, and other things, do not remove
- const AtomicInt64* getInsert() const {
+ const AtomicWord<long long>* getInsert() const {
return &_insert;
}
- const AtomicInt64* getQuery() const {
+ const AtomicWord<long long>* getQuery() const {
return &_query;
}
- const AtomicInt64* getUpdate() const {
+ const AtomicWord<long long>* getUpdate() const {
return &_update;
}
- const AtomicInt64* getDelete() const {
+ const AtomicWord<long long>* getDelete() const {
return &_delete;
}
- const AtomicInt64* getGetMore() const {
+ const AtomicWord<long long>* getGetMore() const {
return &_getmore;
}
- const AtomicInt64* getCommand() const {
+ const AtomicWord<long long>* getCommand() const {
return &_command;
}
private:
// Increment member `counter` by `n`, resetting all counters if it was > 2^60.
- void _checkWrap(CacheAligned<AtomicInt64> OpCounters::*counter, int n);
-
- CacheAligned<AtomicInt64> _insert;
- CacheAligned<AtomicInt64> _query;
- CacheAligned<AtomicInt64> _update;
- CacheAligned<AtomicInt64> _delete;
- CacheAligned<AtomicInt64> _getmore;
- CacheAligned<AtomicInt64> _command;
+ void _checkWrap(CacheAligned<AtomicWord<long long>> OpCounters::*counter, int n);
+
+ CacheAligned<AtomicWord<long long>> _insert;
+ CacheAligned<AtomicWord<long long>> _query;
+ CacheAligned<AtomicWord<long long>> _update;
+ CacheAligned<AtomicWord<long long>> _delete;
+ CacheAligned<AtomicWord<long long>> _getmore;
+ CacheAligned<AtomicWord<long long>> _command;
};
extern OpCounters globalOpCounters;
@@ -124,20 +124,20 @@ public:
void append(BSONObjBuilder& b);
private:
- CacheAligned<AtomicInt64> _physicalBytesIn{0};
- CacheAligned<AtomicInt64> _physicalBytesOut{0};
+ CacheAligned<AtomicWord<long long>> _physicalBytesIn{0};
+ CacheAligned<AtomicWord<long long>> _physicalBytesOut{0};
// These two counters are always incremented at the same time, so
// we place them on the same cache line.
struct Together {
- AtomicInt64 logicalBytesIn{0};
- AtomicInt64 requests{0};
+ AtomicWord<long long> logicalBytesIn{0};
+ AtomicWord<long long> requests{0};
};
CacheAligned<Together> _together{};
static_assert(sizeof(decltype(_together)) <= stdx::hardware_constructive_interference_size,
"cache line spill");
- CacheAligned<AtomicInt64> _logicalBytesOut{0};
+ CacheAligned<AtomicWord<long long>> _logicalBytesOut{0};
};
extern NetworkCounter networkCounter;
diff --git a/src/mongo/db/stats/timer_stats.h b/src/mongo/db/stats/timer_stats.h
index f1153f90ba5..31cbfeba9cb 100644
--- a/src/mongo/db/stats/timer_stats.h
+++ b/src/mongo/db/stats/timer_stats.h
@@ -58,8 +58,8 @@ public:
}
private:
- AtomicInt64 _num;
- AtomicInt64 _totalMillis;
+ AtomicWord<long long> _num;
+ AtomicWord<long long> _totalMillis;
};
/**