--

Comments

boombatower’s picture

boombatower’s picture

Assigned: Unassigned » boombatower
echo urldecode($url);

Results in:

http://chart.apis.google.com/chart?chd=t:2,-1&cht=p3&chs=400x150&chl=Active:
boombatower’s picture

The only logical way a -1 could be created is from the math on line 102 of pifr_server.page.inc

$queue_count = pifr_server_statistic_queue_count() - $active_count;

Meaning $active_count has to be bigger then queue_count().

function pifr_server_statistic_active_count() {
  static $active_count;

  if (!isset($active_count)) {
    $result = db_query('SELECT COUNT(test_id)
                        FROM (
                          SELECT s.test_id
                          FROM {pifr_environment_status} s
                          JOIN {pifr_test} t
                            ON s.test_id = t.test_id
                          WHERE t.type != %d
                          GROUP BY test_id
                        ) x', PIFR_SERVER_TEST_TYPE_CLIENT);
    $active_count = db_result($result);
  }
  return $active_count;
}
function pifr_server_statistic_queue_count() {
  static $queue_count;

  if (!isset($queue_count)) {
    $result = db_query('SELECT COUNT(test_id)
                        FROM {pifr_test}
                        WHERE type != %d
                        AND status = %d', PIFR_SERVER_TEST_TYPE_CLIENT, PIFR_SERVER_TEST_STATUS_QUEUED);
    $queue_count = db_result($result);
  }
  return $queue_count;
}
boombatower’s picture

FROM {pifr_environment_status} s

Makes sense since a test could be active in multiple environments at once.

boombatower’s picture

Status: Active » Needs review
StatusFileSize
new913 bytes
boombatower’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.