Added results statistics to API.
This commit is contained in:
parent
1651b041de
commit
9e9cddedc5
21 changed files with 265 additions and 57 deletions
|
@ -25,6 +25,7 @@
|
|||
#define __APISTATE_H__
|
||||
|
||||
|
||||
#include "api/Results.h"
|
||||
#include "jansson.h"
|
||||
|
||||
|
||||
|
@ -39,13 +40,16 @@ public:
|
|||
|
||||
const char *get(const char *url, size_t *size) const;
|
||||
void tick(const Hashrate *hashrate);
|
||||
void tick(const Results &results);
|
||||
|
||||
private:
|
||||
const char *finalize(json_t *reply, size_t *size) const;
|
||||
void genId();
|
||||
void getConnection(json_t *reply) const;
|
||||
void getHashrate(json_t *reply) const;
|
||||
void getIdentify(json_t *reply) const;
|
||||
void getMiner(json_t *reply) const;
|
||||
void getResults(json_t *reply) const;
|
||||
|
||||
char m_id[17];
|
||||
char m_workerId[128];
|
||||
|
@ -54,6 +58,7 @@ private:
|
|||
double m_totalHashrate[3];
|
||||
int m_threads;
|
||||
mutable char m_buf[4096];
|
||||
Results m_results;
|
||||
};
|
||||
|
||||
#endif /* __APISTATE_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue