Browse Source

add averages

tags/0.1.0
Zane C. B-H 1 month ago
parent
commit
b6242ac20e
2 changed files with 7 additions and 3 deletions
  1. 1
    1
      Git-PunchCard/bin/punchcard-git
  2. 6
    2
      Git-PunchCard/lib/Git/PunchCard.pm

+ 1
- 1
Git-PunchCard/bin/punchcard-git View File

@@ -152,7 +152,7 @@ foreach my $day ( @days ){
152 152
 
153 153
 $table->load( @data );
154 154
 
155
-print $table."\nTotal: ".$card->{total}."\nHourly Max=".$card->{max}."\n";
155
+print $table."\nTotal: ".$card->{total}."\nHourly Max=".$card->{max}."\nAverage=".$card->{average}."\n";
156 156
 
157 157
 =head1 NAME
158 158
 

+ 6
- 2
Git-PunchCard/lib/Git/PunchCard.pm View File

@@ -12,11 +12,11 @@ Git::PunchCard - Gathers info for making punchcard style graphs for git.
12 12
 
13 13
 =head1 VERSION
14 14
 
15
-Version 0.0.1
15
+Version 0.1.0
16 16
 
17 17
 =cut
18 18
 
19
-our $VERSION = '0.0.1';
19
+our $VERSION = '0.1.0';
20 20
 
21 21
 
22 22
 =head1 SYNOPSIS
@@ -361,8 +361,12 @@ sub dir {
361 361
 				$self->{card}{$day}{max}=$self->{card}{$day}{$hour};
362 362
 			}
363 363
 		}
364
+
365
+		$self->{card}{$day}{average}= $self->{card}{$day}{total} / 24;
364 366
 	}
365 367
 
368
+	$self->{card}{average}= $self->{card}{total} / 168 ;
369
+
366 370
 	return 1;
367 371
 }
368 372
 

Loading…
Cancel
Save