MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / Count

Method Count

include/util/timed_histogram.hpp:27–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25{
26 public:
27 void Count(std::size_t pos)
28 {
29 std::lock_guard<std::mutex> guard(frames_lock);
30 auto frame_index = detail::operation++ / TimeBinSize;
31
32 while (frame_offsets.size() <= frame_index)
33 {
34 frame_offsets.push_back(frame_counters.size());
35 }
36 BOOST_ASSERT(frame_offsets.size() == frame_index + 1);
37
38 auto frame_offset = frame_offsets.back();
39 auto counter_index = frame_offset + pos / IndexBinSize;
40
41 while (counter_index >= frame_counters.size())
42 {
43 frame_counters.push_back(0);
44 }
45
46 BOOST_ASSERT(frame_counters.size() > counter_index);
47 frame_counters[counter_index]++;
48 }
49
50 // Returns the measurments as a CSV file with the columns:
51 // frame_id,index_bin,count

Callers 1

findObviousTurnMethod · 0.45

Calls 3

sizeMethod · 0.45
push_backMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected