32 unique_lock<mutex> lock(m_state.mutex);
33 clock_t start_clocks=0, stop_clocks=0;
35 double clocks_per_usec = (double)CLOCKS_PER_SEC / 1000000.0;
38 m_mutator.reset(m_table->create_mutator(0, m_mutator_flags,
39 m_shared_mutator_flush_interval));
45 while (!m_state.finished || !m_state.requests.empty()) {
46 m_state.cond.wait(lock, [
this](){
47 return !m_state.requests.empty() || m_state.finished; });
48 if (!m_state.requests.empty()) {
49 LoadRec *request = m_state.requests.front();
51 start_clocks = clock();
54 m_mutator->set_delete(request->
key);
59 stop_clocks = clock();
60 if (stop_clocks < start_clocks)
61 latency = ((std::numeric_limits<clock_t>::max() - start_clocks) + stop_clocks) / clocks_per_usec;
63 latency = (stop_clocks-start_clocks) / clocks_per_usec;
64 m_state.cum_latency += latency;
65 m_state.cum_sq_latency += pow(latency,2);
66 if (m_state.min_latency == 0 || latency < m_state.min_latency)
67 m_state.min_latency = latency;
68 if (latency > m_state.max_latency)
69 m_state.max_latency = latency;
71 m_state.requests.pop_front();
72 m_state.garbage.push_back(request);
Compatibility Macros for C/C++.
This is a generic exception class for Hypertable.