mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 00:25:27 +00:00
bb91f370a4
refactored some bits. Fixed some value-axis label display problems. Massively reworked back-end storage; everything's in one database now, and can handle multiple types of graph data.
48 lines
1.1 KiB
Perl
Executable File
48 lines
1.1 KiB
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
print "Content-type: text/plain\n\n";
|
|
|
|
#foreach my $k (keys(%ENV)) {
|
|
# print "$k => " . $ENV{$k} . "\n";
|
|
#}
|
|
|
|
my $QS = $ENV{"QUERY_STRING"};
|
|
my %query = ();
|
|
|
|
{
|
|
my @qp = split /\&/,$QS;
|
|
foreach my $q (@qp) {
|
|
my @qp1 = split /=/,$q;
|
|
$query{$qp1[0]} = $qp1[1];
|
|
}
|
|
}
|
|
|
|
if (defined($query{"setid"})) {
|
|
my $testid = $query{"setid"};
|
|
|
|
print "{ resultcode: 0, results: [";
|
|
|
|
srand();
|
|
|
|
my $lv = 200 + rand (100);
|
|
foreach my $k (1 .. 500) {
|
|
#my $kv = $k;
|
|
#my $v = $k;
|
|
my $kv = 1148589000 + ($k*60*20);
|
|
my $v = $lv;
|
|
$lv = $lv + (rand(10) - 5);
|
|
print "$kv, $v, ";
|
|
}
|
|
print "] }";
|
|
} else {
|
|
print "{ resultcode: 0, results: [
|
|
{ id: 1, machine: 'tbox1', test: 'test1', test_type: 'perf', extra_data: null },
|
|
{ id: 4, machine: 'tbox2', test: 'test1', test_type: 'perf', extra_data: null },
|
|
{ id: 3, machine: 'tbox1', test: 'test3', test_type: 'perf', extra_data: null },
|
|
{ id: 6, machine: 'tbox3', test: 'test3', test_type: 'perf', extra_data: null },
|
|
{ id: 2, machine: 'tbox1', test: 'test2', test_type: 'perf', extra_data: null },
|
|
{ id: 5, machine: 'tbox2', test: 'test2', test_type: 'perf', extra_data: null },
|
|
] }";
|
|
}
|
|
|