Add class Telemetry.
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#include "Console.h"
|
||||
|
||||
#include "Cpu.h"
|
||||
#include "Mem.h"
|
||||
@@ -32,6 +35,8 @@ Worker::Worker(Handle *handle) :
|
||||
m_nicehash(handle->nicehash()),
|
||||
m_id(handle->threadId()),
|
||||
m_threads(handle->threads()),
|
||||
m_hashCount(0),
|
||||
m_timestamp(0),
|
||||
m_count(0),
|
||||
m_sequence(0)
|
||||
{
|
||||
@@ -48,3 +53,13 @@ Worker::Worker(Handle *handle) :
|
||||
Worker::~Worker()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Worker::storeStats()
|
||||
{
|
||||
using namespace std::chrono;
|
||||
|
||||
const uint64_t timestamp = time_point_cast<milliseconds>(high_resolution_clock::now()).time_since_epoch().count();
|
||||
m_hashCount.store(m_count, std::memory_order_relaxed);
|
||||
m_timestamp.store(timestamp, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user