Skip to content

Commit

Permalink
Report hash rates from miner
Browse files Browse the repository at this point in the history
  • Loading branch information
fireduck64 committed Jun 14, 2018
1 parent e094266 commit bbfeb11
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions miner/src/PoolMiner.java
Expand Up @@ -5,6 +5,7 @@
import duckutil.ConfigFile;
import duckutil.TimeRecord;
import duckutil.TimeRecordAuto;
import duckutil.RateReporter;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.stub.StreamObserver;
Expand Down Expand Up @@ -69,6 +70,7 @@ public static void main(String args[]) throws Exception
private File snow_path;

private TimeRecord time_record;
private RateReporter rate_report=new RateReporter();

public PoolMiner(Config config) throws Exception
{
Expand Down Expand Up @@ -186,7 +188,9 @@ public void stop()
public void printStats()
{
long now = System.currentTimeMillis();
double count = op_count.getAndSet(0L);
long count_long = op_count.getAndSet(0L);
double count = count_long;
rate_report.record(count_long);

double time_ms = now - last_stats_time;
double time_sec = time_ms / 1000.0;
Expand All @@ -207,7 +211,8 @@ public void printStats()
}


logger.info(String.format("Mining rate: %s/sec %s", df.format(rate), block_time_report));
logger.info(String.format("15 Second mining rate: %s/sec %s", df.format(rate), block_time_report));
logger.info(rate_report.getReportShort(df));

last_stats_time = now;

Expand Down

0 comments on commit bbfeb11

Please sign in to comment.