Skip to content

Commit

Permalink
Merge pull request MPOS#1485 from Neozonz/issue-1484
Browse files Browse the repository at this point in the history
[Optimize] By default only sample 3 minutes worth of shares
  • Loading branch information
TheSerapher committed Jan 21, 2014
2 parents 6bb9ccb + c42a9f5 commit 98e6194
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions public/include/classes/statistics.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function insertPPLNSStatistics($aStats, $iBlockId) {
* @param none
* @return data object Return our hashrateas an object
**/
public function getCurrentHashrate($interval=600) {
public function getCurrentHashrate($interval=180) {
$this->debug->append("STA " . __METHOD__, 4);
if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__)) return $data;
$stmt = $this->mysqli->prepare("
Expand Down Expand Up @@ -245,7 +245,7 @@ public function getCurrentHashrate($interval=600) {
* @param none
* @return data object Our share rate in shares per second
**/
public function getCurrentShareRate($interval=600) {
public function getCurrentShareRate($interval=180) {
$this->debug->append("STA " . __METHOD__, 4);
if ($data = $this->memcache->get(__FUNCTION__)) return $data;
$stmt = $this->mysqli->prepare("
Expand Down Expand Up @@ -452,7 +452,7 @@ public function getAllUserStats($filter='%',$limit=1,$start=0) {
* Fetch all user hashrates based on shares and archived shares
* @return data integer Current Hashrate in khash/s
**/
public function getAllUserMiningStats($interval=600) {
public function getAllUserMiningStats($interval=180) {
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("
SELECT
Expand Down Expand Up @@ -498,7 +498,7 @@ public function getAllUserMiningStats($interval=600) {
* @param account_id integer User ID
* @return data integer Current Hashrate in khash/s
**/
public function getUserHashrate($account_id, $interval=600) {
public function getUserHashrate($account_id, $interval=180) {
$this->debug->append("STA " . __METHOD__, 4);
// Dual-caching, try statistics cron first, then fallback to local, then fallbock to SQL
if ($data = $this->memcache->get(STATISTICS_ALL_USER_HASHRATES)) {
Expand Down Expand Up @@ -560,7 +560,7 @@ public function getUserUnpaidPPSShares($account_id, $last_paid_pps_id) {
* @param interval int Data interval in seconds
* @return double Share difficulty or 0
**/
public function getUserShareDifficulty($account_id, $interval=600) {
public function getUserShareDifficulty($account_id, $interval=180) {
$this->debug->append("STA " . __METHOD__, 4);
// Dual-caching, try statistics cron first, then fallback to local, then fallbock to SQL
if ($data = $this->memcache->get(STATISTICS_ALL_USER_HASHRATES)) {
Expand Down Expand Up @@ -589,7 +589,7 @@ public function getUserShareDifficulty($account_id, $interval=600) {
* @param account_id integer User ID
* @return data integer Current Sharerate in shares/s
**/
public function getUserSharerate($account_id, $interval=600) {
public function getUserSharerate($account_id, $interval=180) {
$this->debug->append("STA " . __METHOD__, 4);
// Dual-caching, try statistics cron first, then fallback to local, then fallbock to SQL
if ($data = $this->memcache->get(STATISTICS_ALL_USER_HASHRATES)) {
Expand Down Expand Up @@ -633,7 +633,7 @@ public function getUserSharerate($account_id, $interval=600) {
* @param worker_id int Worker ID to fetch hashrate for
* @return data int Current hashrate in khash/s
**/
public function getWorkerHashrate($worker_id,$interval=600) {
public function getWorkerHashrate($worker_id,$interval=180) {
$this->debug->append("STA " . __METHOD__, 4);
if ($data = $this->memcache->get(__FUNCTION__ . $worker_id)) return $data;
$stmt = $this->mysqli->prepare("
Expand Down

0 comments on commit 98e6194

Please sign in to comment.