mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-07 16:05:05 -05:00
Restored "GET /1/summary" endpoint.
This commit is contained in:
@@ -29,9 +29,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#include "backend/common/Hashrate.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "base/tools/Handle.h"
|
||||
#include "backend/common/Hashrate.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
inline static const char *format(double h, char *buf, size_t size)
|
||||
@@ -162,3 +163,15 @@ const char *xmrig::Hashrate::format(double h, char *buf, size_t size)
|
||||
{
|
||||
return ::format(h, buf, size);
|
||||
}
|
||||
|
||||
|
||||
rapidjson::Value xmrig::Hashrate::normalize(double d)
|
||||
{
|
||||
using namespace rapidjson;
|
||||
|
||||
if (!std::isnormal(d)) {
|
||||
return Value(kNullType);
|
||||
}
|
||||
|
||||
return Value(floor(d * 100.0) / 100.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user