Changeset - db71228a4c23
[Not reviewed]
beta
0 4 0
Marcin Kuzminski - 15 years ago 2011-02-24 23:44:21
marcin@python-works.com
moved statistics parse_limit into .ini files
decreased celery max task per child to 1 for better memory usage
stats task take usage of new slice option of repository
4 files changed with 16 insertions and 11 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -45,8 +45,10 @@ static_files = true
 
lang=en
 
cache_dir = %(here)s/data
 
index_dir = %(here)s/data/index
 
app_instance_uuid = develop
 
cut_off_limit = 256000
 
force_https = false
 
commit_parse_limit = 25
 

	
 
####################################
 
###        CELERY CONFIG        ####
 
@@ -70,7 +72,7 @@ celery.result.serialier = json
 
celeryd.concurrency = 2
 
#celeryd.log.file = celeryd.log
 
celeryd.log.level = debug
 
celeryd.max.tasks.per.child = 3
 
celeryd.max.tasks.per.child = 1
 

	
 
#tasks will never be sent to the queue, but executed locally instead.
 
celery.always.eager = false
 
@@ -78,8 +80,9 @@ celery.always.eager = false
 
####################################
 
###         BEAKER CACHE        ####
 
####################################
 
beaker.cache.data_dir=/%(here)s/data/cache/data
 
beaker.cache.lock_dir=/%(here)s/data/cache/lock
 
beaker.cache.data_dir=%(here)s/data/cache/data
 
beaker.cache.lock_dir=%(here)s/data/cache/lock
 

	
 
beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
 

	
 
beaker.cache.super_short_term.type=memory
production.ini
Show inline comments
 
@@ -47,6 +47,7 @@ cache_dir = %(here)s/data
 
index_dir = %(here)s/data/index
 
cut_off_limit = 256000
 
force_https = false
 
commit_parse_limit = 250
 

	
 
####################################
 
###        CELERY CONFIG        ####
 
@@ -70,7 +71,7 @@ celery.result.serialier = json
 
celeryd.concurrency = 2
 
#celeryd.log.file = celeryd.log
 
celeryd.log.level = debug
 
celeryd.max.tasks.per.child = 3
 
celeryd.max.tasks.per.child = 1
 

	
 
#tasks will never be sent to the queue, but executed locally instead.
 
celery.always.eager = false
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -48,6 +48,7 @@ index_dir = %(here)s/data/index
 
app_instance_uuid = ${app_instance_uuid}
 
cut_off_limit = 256000
 
force_https = false 
 
commit_parse_limit = 50
 

	
 
####################################
 
###        CELERY CONFIG        ####
 
@@ -71,7 +72,7 @@ celery.result.serialier = json
 
celeryd.concurrency = 2
 
#celeryd.log.file = celeryd.log
 
celeryd.log.level = debug
 
celeryd.max.tasks.per.child = 3
 
celeryd.max.tasks.per.child = 1
 

	
 
#tasks will never be sent to the queue, but executed locally instead.
 
celery.always.eager = false
rhodecode/lib/celerylib/tasks.py
Show inline comments
 
@@ -104,7 +104,7 @@ def get_commits_stats(repo_name, ts_min_
 
    repo = get_repo(p)
 

	
 
    skip_date_limit = True
 
    parse_limit = 250 #limit for single task changeset parsing optimal for
 
    parse_limit = int(config['app_conf'].get('commit_parse_limit'))
 
    last_rev = 0
 
    last_cs = None
 
    timegetter = itemgetter('time')
 
@@ -135,8 +135,9 @@ def get_commits_stats(repo_name, ts_min_
 
    lmktime = mktime
 

	
 
    last_rev = last_rev + 1 if last_rev > 0 else last_rev
 
    for rev in repo.revisions[last_rev:last_rev + parse_limit]:
 
        last_cs = cs = repo.get_changeset(rev)
 

	
 
    for cs in repo[last_rev:last_rev + parse_limit]:
 
        last_cs = cs #remember last parsed changeset
 
        k = lmktime([cs.date.timetuple()[0], cs.date.timetuple()[1],
 
                      cs.date.timetuple()[2], 0, 0, 0, 0, 0, 0])
 

	
 
@@ -209,10 +210,9 @@ def get_commits_stats(repo_name, ts_min_
 
        log.debug('getting code trending stats')
 
        stats.languages = json.dumps(__get_codes_stats(repo_name))
 

	
 
    stats.repository = dbrepo
 
    stats.stat_on_revision = last_cs.revision
 

	
 
    try:
 
        stats.repository = dbrepo
 
        stats.stat_on_revision = last_cs.revision if last_cs else 0
 
        sa.add(stats)
 
        sa.commit()
 
    except:
0 comments (0 inline, 0 general)