domingo, 19 de enero de 2014

X2go Metrics Analysis

X2GO is for having a graphical desktop of computers over a low bandwidth connection. With X2Go you can access your desktop using another computer -- that means both LAN and internet connections. The transmission is done using the ssh protocol, so it is encrypted. By using the free nx libraries from NoMachine, a very acceptable performance in both speed and responsiveness is achieved. Even an ISDN connection runs smoothly.

X2Go's Git projects can be cloned to a local copy through anonymous Git with the following instruction set (in a Unix-like console session). We are going to analyze the following package x2goclient an x2goserver.


janague@metricsGrimoireHost:~/repositories$ mkdir -p x2go
janague@metricsGrimoireHost:~/repositories$ cd x2go/
janague@metricsGrimoireHost:~/repositories/x2go$ git clone git://code.x2go.org/x2goclient.git
Cloning into 'x2goclient'...
remote: Counting objects: 4171, done.
remote: Compressing objects: 100% (3364/3364), done.
remote: Total 4171 (delta 2982), reused 952 (delta 631)
Receiving objects: 100% (4171/4171), 17.88 MiB | 1.11 MiB/s, done.
Resolving deltas: 100% (2982/2982), done.

janague@metricsGrimoireHost:~/repositories/x2go$ git clone git://code.x2go.org/x2goserver.git
Cloning into 'x2goserver'...
remote: Counting objects: 8865, done.
remote: Compressing objects: 100% (2548/2548), done.
remote: Total 8865 (delta 6601), reused 8124 (delta 5930)
Receiving objects: 100% (8865/8865), 1010.62 KiB | 568 KiB/s, done.
Resolving deltas: 100% (6601/6601), done.

Firstly, we are going to use SLOCCount to automatically identify and measure a several languages used in x2go development.


janague@metricsGrimoireHost:~/repositories/x2go$ sloccount x2goclient
Have a non-directory at the top, so creating directory top_dir
Adding /home/janague/repositories/x2go/x2goclient/AUTHORS to top_dir
...
Adding /home/janague/repositories/x2go/x2goclient/xsettingswidget.h to top_dir
Categorizing files.
Finding a working MD5 command....
Found a working MD5 command.
Computing results.

SLOC    Directory    SLOC-by-Language (Sorted)
22456   top_dir         cpp=21612,perl=768,sh=76
2352    qtbrowserplugin-2.4_1-opensource cpp=2352
512     examples        perl=512
40      debian          sh=40
28      x2go-logos      sh=28
12      portable        cpp=12
2       nsis            sh=2
0       desktop         (none)
0       icons           (none)
0       man             (none)
0       png             (none)
0       provider        (none)
0       svg             (none)
0       txt             (none)

Totals grouped by language (dominant language first):
cpp:          23976 (94.39%)
perl:          1280 (5.04%)
sh:             146 (0.57%)

Total Physical Source Lines of Code (SLOC)                = 25,402
Development Effort Estimate, Person-Years (Person-Months) = 5.97 (71.67)
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months)                         = 1.06 (12.68)
 (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule)  = 5.65
Total Estimated Cost to Develop                           = $ 806,776
 (average salary = $56,286/year, overhead = 2.40).
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
redistribute it under certain conditions as specified by the GNU GPL license;
see the documentation for details.
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."

In the following graph it shows the programming languages distribution


Therefore, C++ language is dominant in X2goclient package and the total estimated cost to develop is $ 806,776.

In the case of x2goserver package


janague@metricsGrimoireHost:~/repositories/x2go$ sloccount x2goserver/
Have a non-directory at the top, so creating directory top_dir
Adding /home/janague/repositories/x2go/x2goserver//INSTALL to top_dir
...

Totals grouped by language (dominant language first):
perl:          3814 (73.57%)
sh:            1344 (25.93%)
xml:             21 (0.41%)
ansic:            5 (0.10%)

Total Physical Source Lines of Code (SLOC)                = 5,184
Development Effort Estimate, Person-Years (Person-Months) = 1.13 (13.51)
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months)                         = 0.56 (6.72)
 (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule)  = 2.01
Total Estimated Cost to Develop                           = $ 152,069
 (average salary = $56,286/year, overhead = 2.40).
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
redistribute it under certain conditions as specified by the GNU GPL license;
see the documentation for details.
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."

In the following graph it shows the programming languages distribution



Therefore, Perl language is dominant in X2goserver package and the total estimated cost to develop is $ 152,069.


Secondly, we are going to analyse the git repository to know data about community, using commits and committers information. Using CVSAnalY to get data and MariaDB to store and query. So we need to create a new database, for example x2goDB, and execute CVSAnalY



janague@metricsGrimoireHost:~/repositories/x2go$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 79
Server version: 5.5.34-MariaDB-1~precise-log mariadb.org binary distribution
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database x2goDB;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on x2goDB.* to 'janague'@'localhost' identified by 'janague123';
Query OK, 0 rows affected (0.00 sec)

And using the same database for both package


janague@metricsGrimoireHost:~/repositories/x2go/x2goclient$ cvsanaly2 -u janague -d x2goDB
Password:
Parsing log for /home/janague/repositories/x2go/x2goclient (git)
Warning: Detected empty branch 'master', it'll be ignored
Warning: Detected empty branch 'build-main', it'll be ignored
Executing extensions

janague@metricsGrimoireHost:~/repositories/x2go/x2goclient$ cd ..
janague@metricsGrimoireHost:~/repositories/x2go$ cd x2goserver/
janague@metricsGrimoireHost:~/repositories/x2go/x2goserver$ cvsanaly2 -u janague -d x2goDB
Password:
Parsing log for /home/janague/repositories/x2go/x2goserver (git)
Warning: Detected empty branch 'build-baikal', it'll be ignored
Warning: Detected empty branch 'build-main', it'll be ignored
Executing extensions

Following we show different results

1.- Commits per committer limited to the 30 first with the highest accumulated activity


using the next query


select
    year(date),
    month(date),
    day(date),
    count(*)
from
    scmlog
group by year(date), month(date), day(date);

2.- Commits per committer limited to the 30 first with the highest accumulated activity



using the same query and the aggregation is made using a python function.


3.- Commits per committer limited to the 30 first with the highest accumulated activity


using the next query

select
    count(*)
from
    scmlog
group by committer_id
order by count(*) desc
limit 30;

This graph shows that few amount of developers that they develop the vast majority of the source code.

4.- Top 10 of developers, all history.

Using this query 


SELECT COUNT(distinct(scmlog.id)) as total, people.email, people.name
FROM scmlog, actions, people
WHERE scmlog.id = actions.commit_id
AND scmlog.author_id = people.id
GROUP BY people.email
ORDER BY total DESC
LIMIT 10

we have the following result


+-------+--------------------------------------+------------------------+
| total | email                                | name                   |
+-------+--------------------------------------+------------------------+
|  1444 | mike.gabriel@das-netzwerkteam.de     | Mike Gabriel           |
|    83 | oleksandr.shneyder@obviously-nice.de | Oleksandr Shneyder     |
|    55 | o.shneyder@phoca-gmbh.de             | Oleksandr Shneyder     |
|    34 | oleksandr.shneyder@treuchtlingen.de  | Oleksandr Shneyder     |
|    20 | siretart@tauware.de                  | Reinhard Tartler       |
|    14 | ionic@ionic.de                       | Mihai Moldovan         |
|    11 | morty@gmx.net                        | Moritz 'Morty' Strübe  |
|     8 | jengelh@inai.de                      | Jan Engelhardt         |
|     8 | teranders@gmail.com                  | Terje Andersen         |
|     7 | bd.dali@gmail.com                    | Daniel Lindgren        |
+-------+--------------------------------------+------------------------+
10 rows in set (0.05 sec)

Conclusion
This community is only 3 years of life, really young, with a outstanding and continuous activity but with a huge problem of maintenance and sustainability, because almost the 83% of commits are made for the same contributor.


References
[0] X2go homepage
[1] <package> names 
[2] SLOCCount
[3] CVSAnalY
[4] script by Daniel Izquierdo Cortazar <dizquierdo@libresoft.es>
[5] matplotlib
[6] SciPy

No hay comentarios:

Publicar un comentario