diff --git a/website/UPDATE.php b/website/UPDATE.php
index b78f9a0..b490d9a 100644
--- a/website/UPDATE.php
+++ b/website/UPDATE.php
@@ -62,19 +62,21 @@ if (isset($_GET['awake']) && $_GET['awake'] == 'yes') {
}
// Report score of a benchmark total or subtest.
-$name = mysql_real_escape_string(GET_string('name'));
$time = mysql_real_escape_string(GET_string('time'));
-$suite_id = find_suite(GET_string('suite'));
$mode_id = find_mode(GET_string('mode'));
$run = GET_run_id('run');
-if ($name == '__total__') {
+$version = GET_string('suite');
+if (isset($_GET['version']))
+ $version = GET_string('version');
+$suite_version_id = find_or_add_suite_version(GET_string('suite'), $version);
+if (GET_string('name') == '__total__') {
mysql_query("INSERT INTO awfy_score
- (run_id, suite_id, mode_id, score)
+ (run_id, suite_version_id, mode_id, score)
VALUES
- ($run, $suite_id, $mode_id, $time)")
+ ($run, $suite_version_id, $mode_id, $time)")
or die("ERROR: " . mysql_error());
} else {
- $test_id = find_or_add_test($suite_id, $name);
+ $test_id = find_or_add_test($suite_version_id, GET_string('name'));
mysql_query("INSERT INTO awfy_breakdown
(run_id, mode_id, score, test_id)
VALUES
diff --git a/website/frontpage.js b/website/frontpage.js
index 49f5914..7545d50 100644
--- a/website/frontpage.js
+++ b/website/frontpage.js
@@ -425,15 +425,24 @@ Display.prototype.createToolTip = function (item, extended) {
var so = extended ? '' : '';
var sc = extended ? '' : '';
- var x = item.datapoint[0];
- var y = item.datapoint[1];
- var text = so + 'score: ' + sc + y.toFixed() + '
';
-
// Figure out the line this corresponds to.
var line = this.graph.info[item.seriesIndex];
if (!line)
return;
+ var text = "";
+ var x = item.datapoint[0];
+ var y = item.datapoint[1];
+
+ // Show suite version.
+ if (line.data[x][3]) {
+ var suiteVersion = AWFYMaster.suiteversions[line.data[x][3]];
+ text += so + 'suite: ' + sc + suiteVersion + '
';
+ }
+
+ // Show score.
+ text += so + 'score: ' + sc + y.toFixed() + '
';
+
// Find the point previous to this one.
var prev = null;
for (var i = x - 1; i >= 0; i--) {
diff --git a/website/index.html b/website/index.html
index 4b0aae0..828abd2 100755
--- a/website/index.html
+++ b/website/index.html
@@ -110,10 +110,6 @@
Is this open source?
Fo' sho', https://github.com/haytjes/arewefastyet
-Can I still see the original AWFY, from the JaegerMonkey days?
- -Suggestions?
diff --git a/website/internals.php b/website/internals.php index 71e633f..aac8353 100755 --- a/website/internals.php +++ b/website/internals.php @@ -57,12 +57,29 @@ function find_suite($suite) return intval($row[0]); } -function find_or_add_test($suite_id, $name) +function find_or_add_suite_version($suite, $version) { - $query = "select id from awfy_suite_test where suite_id = $suite_id and name = '$name'"; + $suite_id = find_suite($suite); + if ($suite_id == -1) + return -1; + $query = "select id from awfy_suite_version where suite_id = $suite_id and name = '$version'"; $results = mysql_query($query); if (!$results || mysql_num_rows($results) < 1) { - $query = "insert into awfy_suite_test (suite_id, name) values($suite_id, '$name')"; + $query = "insert into awfy_suite_version (suite_id, name) values($suite_id, '$version')"; + mysql_query($query); + return mysql_insert_id(); + } + $row = mysql_fetch_array($results); + return intval($row[0]); +} + +function find_or_add_test($suite_version_id, $name) +{ + $name = mysql_real_escape_string($name); + $query = "select id from awfy_suite_test where suite_version_id = $suite_version_id and name = '$name'"; + $results = mysql_query($query); + if (!$results || mysql_num_rows($results) < 1) { + $query = "insert into awfy_suite_test (suite_version_id, name) values($suite_version_id, '$name')"; mysql_query($query); return mysql_insert_id(); }