diff --git a/docs/Howto.md b/docs/Howto.md index 8e29d3e47..55f37034c 100644 --- a/docs/Howto.md +++ b/docs/Howto.md @@ -115,10 +115,10 @@ jtest:tracker_ms | int | 200 | Time spent during tracking jtest:tracker_spread | double | 0.25 | Spread of time spent during tracking jtest:tracker_bytes | int | 1000 | Bytes written during tracking jtest:tracker_bytes_spread | double | 0.25 | Spread of bytes written during tracking -jtest:plotter_ms | int | 20 | Time spent during plotting +jtest:plotter_ms | int | 0 | Time spent during plotting jtest:plotter_spread | double | 0.25 | Spread of time spent during plotting jtest:plotter_bytes | int | 1000 | Bytes written during plotting -jtest:plotter_bytes_spread | int | 0.25 | Spread of bytes written during plotting +jtest:plotter_bytes_spread | double | 0.25 | Spread of bytes written during plotting diff --git a/src/plugins/JTest/JTestPlotter.h b/src/plugins/JTest/JTestPlotter.h index 6ce1617b5..53a250b77 100644 --- a/src/plugins/JTest/JTestPlotter.h +++ b/src/plugins/JTest/JTestPlotter.h @@ -8,13 +8,15 @@ #include #include #include "JTestTracker.h" +#include class JTestPlotter : public JEventProcessor { - size_t m_cputime_ms = 20; + size_t m_cputime_ms = 0; size_t m_write_bytes = 1000; double m_cputime_spread = 0.25; double m_write_spread = 0.25; + std::mutex m_mutex; public: @@ -42,6 +44,9 @@ class JTestPlotter : public JEventProcessor { // Read the extra data objects inserted by JTestTracker aEvent->Get(); + // Everything that happens after here is in a critical section + std::lock_guard lock(m_mutex); + // Consume CPU consume_cpu_ms(m_cputime_ms, m_cputime_spread);