NewVision WEB-development Team Blog

CodeSwarm – визуализация коммитов репозитория

codeswarm preview

Codeswarm – Organic software visualization of project repositories. Эта утилитка позволяет визуализировать историю комитов репозитория. Поддерживает репозитории следующих типов: svn, cvs. Судя по логу, последняя активность над проектом была в сентябре 2009 года, так что не уверен что поддержка других репозиториев будет в скором времени реализована.

Визуализация выполняется по схеме:

  • когда разработчик коммитит файлы в репозиторий, подсвечивается его имя и файлы, которые он затронул
  • по мере неактивности разработчика – имя гаснет
  • утилиту можно настроить так, чтобы разные типы файлов подсвечивались разными цветами
  • внизу отображается хронологическая гистограмма общей активности репозитория

Что это дает:

  • вопервых просто интересно и приятно посмотреть на свой визуализированный репозиторий, особенно если наложить на видео звуковую дорожку
  • можно посмотреть историю проекта и пики активности
  • оценить на сколько выполняется – коллективное владение кода
    • чем ближе (и дольше) имена разработчиков отображаются друг к другу – тем больше они работают над совместными файлами

Примеры наших репозиториев

P.S. не забудьте активировать звук…
Get the Flash Player to see this player.

Часть репозитория одного из наших проектов: SeoTop – SMO продвижение

Get the Flash Player to see this player.

Common репозиторий (с функционалом общим для всех проектов)

Get the Flash Player to see this player.


Краткий мануал по созданию видео ролика

1. Устанавливаем codeswarm

mkdir codeswarm
cd codeswarm
svn checkout http://codeswarm.googlecode.com/svn/trunk/ .
mkdir frames
cp data/sample.config data/custom.config

2. Настраиваем конфиг: data/custom.config
Основные изменения в файл:

  • указываем размер кадров width x height
  • цвета для бекграунда и типов файлов
  • флаг TakeSnapshot = true
    • иначе кадры не будут сохраняться

Вот пример нашего файла настроек (codeswarm config sample):

# This is a sample configuration file for code_swarm

# Frame width
Width=480

# Frame height
Height=300

# Input file
InputFile=data/activity.xml

# Particle sprite file
ParticleSpriteFile=src/particle.png

#Font Settings
Font=Monospace Bold
FontSize=11
BoldFontSize=13

# Project time per frame
MillisecondsPerFrame=21600000

# Maximum number of Background processes
MaxThreads=30

# Optional Method instead of MillisecondsPerFrame
#FramesPerDay=4

# Background in R,G,B
Background=0,0,0

# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
#
# Pattern:  "Label", "regex", R,G,B, R,G,B
# Label is optional.  If it is omitted, the regex
# will be used.
#
ColorAssign1="php source",".*php.*", 255,0,0, 255,0,0
ColorAssign2="templates",".*tpl.*", 255,255,0, 255,255,0
ColorAssign3="configs",".*yml.*", 255,255,255, 255,255,255
ColorAssign4="xml",".*xml.*", 0,255,0, 0,255,0
ColorAssign5="images-css-js",".*css|js|jpg|png|jpeg|gif.*", 128,128,255, 128,128,225
ColorAssign5="docs",".*txt|doc|jpg|png|jpeg|gif.*", 26,223,214, 26,223,214

# Save each frame to an image?
TakeSnapshots=true

# Where to save each frame
SnapshotLocation=frames/code_swarm-#####.png

# Draw names (combinatory) :
# Draw sharp names?
DrawNamesSharp=true
# And draw a glow around names? (Runs slower)
DrawNamesHalos=false

# Draw files (combinatory) :
# Draw sharp files
DrawFilesSharp=true
# Draw fuzzy files
DrawFilesFuzzy=true
# Draw jelly files
DrawFilesJelly=true

# Show the Legend at start
ShowLegend=true

# Show the History at start
ShowHistory=true

# Show the Date at start
ShowDate=true

# Show edges between authors and files, mostly for debug purpose
ShowEdges=false

# Turn on Debug counts.
ShowDebug=false

# Natural distance of files to people
EdgeLength=25

# Amount of life to decrement
EdgeDecrement=-2
FileDecrement=-2
PersonDecrement=-1

#Speeds.
#Optional: NodeSpeed=7.0, If used, FileSpeed and PersonSpeed need not be set.
#
FileSpeed=7.0
PersonSpeed=2.0

#Masses
FileMass=1.0
PersonMass=10.0

# Life of an Edge
EdgeLife=250

# Life of a File
FileLife=200

# Life of a Person
PersonLife=255

# Highlight percent.
# This is the amount of time that the person or
# file will be highlighted.
HighlightPct=5

## Physics engine selection and configuration
# Directory physics engine config files reside in.
PhysicsEngineConfigDir=physics_engine
# Force calculation algorithms ("PhysicsEngineLegacy", "PhysicsEngineSimple"...) :
PhysicsEngineSelection=PhysicsEngineLegacy

# OpenGL is experimental. Use at your own risk.
UseOpenGL=false

3. Генерация кадров (изображений)

cd convert_logs
svn log http://svn.your-repository-url -v > activity.log
python convert_logs.py -s activity.log -o ../data/activity.xml
cd ..
./run.sh
# в качестве конфига указать: data/custom.config

4. Компиляция кадров в видео
Необходимо определиться с количеством кадров в секунду. Допустим мы хотим, чтобы ролик продолжался 50 секунд, кол-во сгенерированных изображний в папке frames – 1020. Т.о. кадров в секунду должно быть: 1020 / 50 = 20

cd frames
mencoder mf://*.png -mf fps=20:type=png -ovc lavc -oac copy -o out.avi

5. Наложение звуковой дорожки

mencoder out.avi -o out_music.avi -ovc copy -oac copy -audiofile cool_music.mp3

6. Конвертация во flash видео

ffmpeg -b 800k -i out_music.avi codeswarm.flv

Таким образом, получаем видео в формате подходящим для плеера, который можно вставить на страницу.

Документация

FAQ: http://code.google.com/p/codeswarm/wiki/FAQ
Генерация видео: http://code.google.com/p/codeswarm/wiki/GeneratingAVideo

Похожие статьи

Оставить комментарий