3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements. See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to You under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
21 # Converts Lucene contrib-benchmark output produced using the
22 # conf/shingle.alg file into a JIRA-formatted table.
30 #Operation round runCnt recsPerRun rec/s elapsedSec avgUsedMem avgTotalMem
31 #BigramsAndUnigrams 0 1 255691 21,147.22 12.09 15,501,840 35,061,760
32 #BigramsOnly - - 0 - - 1 - - 127383 - 16,871.92 7.55 - 31,725,312 41,746,432
38 if (/^((?:Uni|Bi|Four)grams\S+)[-\s]*([^\s{].*)/) {
42 = ($operation =~ /^Bigrams/ ? 2 : $operation =~ /^Unigrams/ ? 1 : 4);
44 = ($operation =~ /(?:AndUnigrams|UnigramsOnly)$/ ? 'yes' : 'no');
45 my ($elapsed) = $stats =~ /(?:[\d,.]+[-\s]*){4}([.\d]+)/;
46 $min_elapsed{$max_shingle_size}{$output_unigrams} = $elapsed
47 unless (defined($min_elapsed{$max_shingle_size}{$output_unigrams})
48 && $elapsed >= $min_elapsed{$max_shingle_size}{$output_unigrams});
52 # Print out platform info
53 print "JAVA:\n", `java -version 2>&1`, "\nOS:\n";
58 print Win32::GetOSName(), "\n", Win32::GetOSVersion(), "\n";
60 die "Error loading Win32: $@" if ($@);
62 print `uname -a 2>&1`;
65 print "\n||Max Shingle Size||Unigrams?||Elapsed||\n";
67 for my $max_shingle_size (sort { $a <=> $b } keys %min_elapsed) {
68 for my $output_unigrams (sort keys %{$min_elapsed{$max_shingle_size}}) {
69 my $size = (1 == $max_shingle_size ? '1 (Unigrams)' : $max_shingle_size);
70 printf "|$size|$output_unigrams|\%2.2fs|\n",
71 $min_elapsed{$max_shingle_size}{$output_unigrams};