From c447e55a7a492b7a7e372eb0812ecf60e24d9eaf Mon Sep 17 00:00:00 2001 From: Heikki Hokkanen Date: Mon, 29 Jul 2013 17:42:36 +0300 Subject: [PATCH] Make number of processes configurable. Default to 8. --- doc/gitstats.pod | 4 ++++ gitstats | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/gitstats.pod b/doc/gitstats.pod index bde2c61..2cfbc75 100644 --- a/doc/gitstats.pod +++ b/doc/gitstats.pod @@ -53,6 +53,10 @@ How many domains to show in domains by commits. Maximum file extension length. +=item processes + +Number of concurrent processes to use when extracting git repository data. + =item project_name Project name to show on the generated pages. Default is to use basename of the repository directory. diff --git a/gitstats b/gitstats index ed3a24d..36fb0cb 100755 --- a/gitstats +++ b/gitstats @@ -46,7 +46,8 @@ conf = { 'commit_end': 'HEAD', 'linear_linestats': 1, 'project_name': '', - 'merge_authors': {} + 'merge_authors': {}, + 'processes': 8, } def getpipeoutput(cmds, quiet = False): @@ -448,7 +449,7 @@ class GitDataCollector(DataCollector): revs_to_read.append((time,rev)) #Read revisions from repo - time_rev_count = Pool(processes=24).map(getnumoffilesfromrev, revs_to_read) + time_rev_count = Pool(processes=conf['processes']).map(getnumoffilesfromrev, revs_to_read) #Update cache with new revisions and append then to general list for (time, rev, count) in time_rev_count: -- 2.11.4.GIT