Ver código fonte

Make number of processes configurable.

Default to 8.
Heikki Hokkanen 12 anos atrás
pai
commit
c447e55a7a
2 arquivos alterados com 7 adições e 2 exclusões
  1. 4
    0
      doc/gitstats.pod
  2. 3
    2
      gitstats

+ 4
- 0
doc/gitstats.pod Ver arquivo

@@ -53,6 +53,10 @@ How many domains to show in domains by commits.
53 53
 
54 54
 Maximum file extension length.
55 55
 
56
+=item processes
57
+
58
+Number of concurrent processes to use when extracting git repository data.
59
+
56 60
 =item project_name
57 61
 
58 62
 Project name to show on the generated pages. Default is to use basename of the repository directory.

+ 3
- 2
gitstats Ver arquivo

@@ -46,7 +46,8 @@ conf = {
46 46
 	'commit_end': 'HEAD',
47 47
 	'linear_linestats': 1,
48 48
 	'project_name': '',
49
-	'merge_authors': {}
49
+	'merge_authors': {},
50
+	'processes': 8,
50 51
 }
51 52
 
52 53
 def getpipeoutput(cmds, quiet = False):
@@ -448,7 +449,7 @@ class GitDataCollector(DataCollector):
448 449
 				revs_to_read.append((time,rev))
449 450
 
450 451
 		#Read revisions from repo
451
-		time_rev_count = Pool(processes=24).map(getnumoffilesfromrev, revs_to_read)
452
+		time_rev_count = Pool(processes=conf['processes']).map(getnumoffilesfromrev, revs_to_read)
452 453
 
453 454
 		#Update cache with new revisions and append then to general list
454 455
 		for (time, rev, count) in time_rev_count: