OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.9 KiB

  1. #!/usr/bin/perl
  2. #
  3. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. #
  6. # T2 SDE: scripts/parasim1.pl
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. # Copyright (C) 1998 - 2003 Clifford Wolf
  9. #
  10. # More information can be found in the files COPYING and README.
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; version 2 of the License. A copy of the
  15. # GNU General Public License can be found in the file COPYING.
  16. # --- T2-COPYRIGHT-NOTE-END ---
  17. my $size_x=70;
  18. my $size_y=17;
  19. my @data_val;
  20. my @data_nr;
  21. my $max_x = 0;
  22. my $max_y = 0;
  23. my ($x, $y);
  24. open(F, $ARGV[0]) || die $!;
  25. while (<F>) {
  26. @_ = split /\s+/;
  27. $max_x++;
  28. $max_y=$_[1] if $_[1] > $max_y;
  29. }
  30. close F;
  31. open(F, $ARGV[0]) || die $!;
  32. for ($x=0; <F>; $x++) {
  33. @_ = split /\s+/;
  34. $_ = int(($x*$size_x) / $max_x);
  35. $data_val[$_] = 0 unless defined $data_val[$_];
  36. $data_nr[$_] = 0 unless defined $data_nr[$_];
  37. $data_val[$_] += $_[1];
  38. $data_nr[$_]++;
  39. }
  40. close(F);
  41. $max_y=$ARGV[1] if $ARGV[1] > 0;
  42. my @leftlabel=qw/. . P a r a l l e l . J o b s . ./;
  43. print "\n ----+----------------------------------------" .
  44. "------------------------------+\n";
  45. for ($y=$size_y; $y>0; $y--) {
  46. if ($y == $size_y) { printf(" %3d |", $max_y); }
  47. elsif ($y == 1) { print " 1 |"; }
  48. else {
  49. print " ", ($leftlabel[$size_y - $y] ne '.' ?
  50. $leftlabel[$size_y - $y] : ' '), " |";
  51. }
  52. for ($x=0; $x<$size_x; $x++) {
  53. $_ = ($data_val[$x]*$size_y*2 / $data_nr[$x]) / $max_y;
  54. if ($_ >= $y*2-1) { print ":"; }
  55. elsif ($_ >= $y*2-2) { print "."; }
  56. else { print " "; }
  57. }
  58. print "|\n";
  59. }
  60. print " ----+----------------------------------------" .
  61. "------------------------------+\n";
  62. printf(" | 1 Number of Jobs build so far " .
  63. " %5d |\n\n", $max_x);