Counter function added

Reviewers: buda, mferencevic, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D787
This commit is contained in:
florijan
2017-09-13 17:09:04 +02:00
parent 9d63dfa9ca
commit bfbec8d550
8 changed files with 84 additions and 14 deletions

View File

@@ -328,3 +328,9 @@ const std::string &GraphDbAccessor::PropertyName(
debug_assert(!commited_ && !aborted_, "Accessor committed or aborted");
return *property;
}
int64_t GraphDbAccessor::Counter(const std::string &name) {
return db_.counters_.access()
.emplace(name, std::make_tuple(name), std::make_tuple(0))
.first->second.fetch_add(1);
}