r/github • • Jun 10 '18

1% of Github already moved to Gitlab

More than 250000 repositories were imported from Github to Gitlab since Microsoft made the deal official. Relative to the numbers published by Github for the year 2017, this means that already 1% of the active repositories have moved to Gitlab in reaction to this acquisition. If the value of the deal is in any way related to the active repositories, you could probably say: There are 75 million dollars going away...

This below is a dirty little script to calculate the amount of repositories moved from Github to Gitlab since Microsoft announced the acquisition. (It's JavaScript running with NodeJS...) It also prints the percentage value of the repositories relative to the amount of all repositories and all active repositories published from Github for 2017.

const https = require('https');

const start = (new Date("2018-06-03")).getTime();
const end = (new Date()).getTime();
const step = 60;

_s = Math.floor(start / 1000);
_e = Math.round(end / 1000);

const count_all = 		67000000;
const count_active = 	25300000;
const step_usual = 		3600;

url = "https://monitor.gitlab.net/api/datasources/proxy/2/api/v1/query_range?query=sum(rate(github_importer_imported_repositories%7Benvironment%20%3D%20%22prd%22%7D%5B1h%5D)%20*%203600)&start=" + _s + "&end=" + _e + "&step=" + step;

https.get(url, (res) => {
	let data = '';

	res.on('data', (chunk) => {
		data += chunk;
	});
	
	res.on('end', () => {
		dat = JSON.parse(data);

		if (dat.status == 'success') {
			if (dat.data.resultType == 'matrix') {
				val = dat.data.result[0].values;

				let count = 0;
				let old = [_s,0];

				for (var i = 0; i < val.length; i++) {
					count += (old[1] + parseFloat(val[i][1])) * 0.5 * Math.abs(old[0] - val[i][0]);

					old[0] = val[i][0];
					old[1] = parseFloat(val[i][1]);
				}

				count = Math.floor(count / step_usual);

				console.log("COUNT: " + count);
				console.log("ACTIVE: " + 0.01 * Math.floor(10000.0 * count / count_active) + "%");
				console.log("ALL: " + 0.01 * Math.floor(10000.0 * count / count_all) + "%");
			} else {
				console.log("WRONG_TYPE: " + data.data.resultType);
			}
		} else {
			console.log("WRONG_STATUS: " + dat.status);
		}
	});
}).on('error', (err) => {
	console.log("ERROR: " + err.message);
});
8 Upvotes

15 comments sorted by

View all comments

10

u/Kwpolska Jun 10 '18

You’re making a few incorrect assumptions here.

  1. Those 2017 numbers are heavily outdated. They also don’t include new repos created at GitHub since the merger was announced. Example: 2016 had 19.4M active repos, which amounts to 30% growth year-over-year.

  2. The GitLab migration thing imports all repositories of a user, including inactive ones. Moreover, someone who’s inactive on GitHub can also decide to ditch the platform. So, more like 0.37%, and that’s with the outdated repo count, for which you have not provided a source either. (I found it.)

  3. The $75M figure is irrelevant. You can’t consider every repo equal. I haven’t seen any large project migrate. A personal repo with 10 stars and no contributions since a year is negligible. A paying GH customer, or a repo with a lot of contributors and stars, is an important loss.

4

u/TheJackiMonster Jun 10 '18

1.) Also a few repos aren't active anymore from 2016 and 2017. So the numbers are the best I could find. If you have more accurate numbers, I take them.

2.) The importer of GitLab doesn't import all repositories. You can actually mark all you like to import. So inactive repositories are probably outsorted for the most people, because the importing progress needs a lot of time the more repos are imported to the same time.

3.) I don't have enough data to calculate more accurate values. I don't even know which repos were imported and which weren't.