Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: chrome/test/data/dromaeo/store.php

Issue 269054: Importing dromaeo performance tests to src/chrome/test/data.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/dromaeo/reset.css ('k') | chrome/test/data/dromaeo/test-head.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <?php
2
3 $server = 'mysql.dromaeo.com';
4 $user = 'dromaeo';
5 $pass = 'dromaeo';
6
7 require('JSON.php');
8
9 $json = new Services_JSON();
10 $sql = mysql_connect( $server, $user, $pass );
11
12 mysql_select_db( 'dromaeo' );
13
14 $id = str_replace(';', "", $_REQUEST['id']);
15
16 if ( $id ) {
17 $sets = array();
18 $ids = split(",", $id);
19
20 foreach ($ids as $i) {
21 $query = mysql_query( "SELECT * FROM runs WHERE id=$i;" );
22 $data = mysql_fetch_assoc($query);
23
24 $query = mysql_query( "SELECT * FROM results WHERE run_i d=$i;" );
25 $results = array();
26
27 while ( $row = mysql_fetch_assoc($query) ) {
28 array_push($results, $row);
29 }
30
31 $data['results'] = $results;
32 $data['ip'] = '';
33
34 array_push($sets, $data);
35 }
36
37 echo $json->encode($sets);
38 } else {
39 $data = $json->decode(str_replace('\\"', '"', $_REQUEST['data']) );
40
41 if ( $data ) {
42 mysql_query( sprintf("INSERT into runs VALUES(NULL,'%s','%s',NOW (),'%s');",
43 $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR'], st r_replace(';', "", $_REQUEST['style'])) );
44
45 $id = mysql_insert_id();
46
47 if ( $id ) {
48
49 foreach ($data as $row) {
50 mysql_query( sprintf("INSERT into results VALUES(NULL,'% s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');",
51 $id, $row->collection, $row->version, $row->name , $row->scale, $row->median, $row->min, $row->max, $row->mean, $row->deviation, $row->runs) );
52 }
53
54 echo $id;
55 }
56 }
57 }
58 ?>
OLDNEW
« no previous file with comments | « chrome/test/data/dromaeo/reset.css ('k') | chrome/test/data/dromaeo/test-head.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698