Restored "GET /1/summary" endpoint.
This commit is contained in:
parent
691b2fabbf
commit
d9164c0b7b
14 changed files with 199 additions and 108 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue