* removed musl and openssl from btrfs-progs.cache
[t2sde.git] / scripts / parasim1.pl
blobdace949023b4e6b260a234ac51840d51a9960687
1 #!/usr/bin/perl
3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # T2 SDE: scripts/parasim1.pl
5 # Copyright (C) 2004 - 2022 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
7 #
8 # This Copyright note is generated by scripts/Create-CopyPatch,
9 # more information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License version 2.
13 # --- T2-COPYRIGHT-NOTE-END ---
15 my $size_x=70;
16 my $size_y=17;
18 my @data_val;
19 my @data_nr;
20 my $max_x = 0;
21 my $max_y = 0;
23 my ($x, $y);
25 open(F, $ARGV[0]) || die $!;
26 while (<F>) {
27 @_ = split /\s+/;
28 $max_x++;
29 $max_y=$_[1] if $_[1] > $max_y;
31 close F;
33 open(F, $ARGV[0]) || die $!;
34 for ($x=0; <F>; $x++) {
35 @_ = split /\s+/;
36 $_ = int(($x*$size_x) / $max_x);
38 $data_val[$_] = 0 unless defined $data_val[$_];
39 $data_nr[$_] = 0 unless defined $data_nr[$_];
41 $data_val[$_] += $_[1];
42 $data_nr[$_]++;
44 close(F);
46 $max_y=$ARGV[1] if $ARGV[1] > 0;
48 my @leftlabel=qw/. . P a r a l l e l . J o b s . ./;
50 print "\n ----+----------------------------------------" .
51 "------------------------------+\n";
53 for ($y=$size_y; $y>0; $y--) {
54 if ($y == $size_y) { printf(" %3d |", $max_y); }
55 elsif ($y == 1) { print " 1 |"; }
56 else {
57 print " ", ($leftlabel[$size_y - $y] ne '.' ?
58 $leftlabel[$size_y - $y] : ' '), " |";
61 for ($x=0; $x<$size_x; $x++) {
62 $_ = ($data_val[$x]*$size_y*2 / $data_nr[$x]) / $max_y;
63 if ($_ >= $y*2-1) { print ":"; }
64 elsif ($_ >= $y*2-2) { print "."; }
65 else { print " "; }
67 print "|\n";
70 print " ----+----------------------------------------" .
71 "------------------------------+\n";
73 printf(" | 1 Number of Jobs build so far " .
74 " %5d |\n\n", $max_x);