[CCPPETMR/SIRF-SuperBuild] Number of users (#93)

0 views
Skip to first unread message

Casper da Costa-Luis

unread,
Feb 16, 2018, 7:15:16 PM2/16/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

We'd like to estimate the number of users. Sum:

  • (SuperBuild clones) - (number of travis non-docker jobs) - 2*(number of travis docker jobs) - (a little extra for devs locally cloning?)
  • (docker pulls) - (number of travis docker jobs)
  • VM binary downloads

The main problem I see is (SuperBuild clones) is only accessible at https://github.com/CCPPETMR/SIRF-SuperBuild/graphs/traffic if you are logged in to github (not publicly accessible via a JSON API) so I can't get that data to generate a badge.

So... would it be OK to generate that data ourselves using cmake? By that I mean something like:

file(DOWNLOAD "http://caspersci.uk.to/cgi-bin/hits.cgi?q=sirf-superbuild" "tmpfile")
file(REMOVE "tmpfile")

And then get .travis.yml to call

wget https://caspersci.uk.to/cgi-bin/hits.cgi?q=sirf-superbuild-travis

a few times... that way I can give you something like:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Casper da Costa-Luis

unread,
Feb 16, 2018, 7:16:04 PM2/16/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

Casper da Costa-Luis

unread,
Feb 16, 2018, 7:56:00 PM2/16/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

@paskino for VM binary downloads, you may want to use something link https://stackoverflow.com/questions/21982862/how-to-count-link-clicks#21982932

Edoardo Pasca

unread,
Feb 17, 2018, 3:38:25 AM2/17/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

There's a way directly in Drupal to count them.

Edoardo Pasca

unread,
Feb 19, 2018, 4:37:44 AM2/19/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

Accessing the clones via the GitHub API requires, as Casper said, an authorized webapp. So it can't be a simple script. I developed an authorized webapp to query GitHub API and I may modify to get the relevant info.

At any rate, data which can be collected is only for the last 14 days.

Edoardo Pasca

unread,
Feb 19, 2018, 6:37:28 AM2/19/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

I managed to get drupal track the downloads of SIRF VM. ATM the info is not publicly available. Do we need live info?

Kris Thielemans

unread,
Feb 19, 2018, 7:37:04 AM2/19/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

no need to be live as far as I can see

Kris Thielemans

unread,
Feb 19, 2018, 10:03:54 AM2/19/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

@casperdcl I think we don't need the badge as that seems quite complicated at the moment (especially agregating it all). It'd be ok if we can keep track of that ourselves. We could then periodically update the website ourselves.

I'm not 100% sure now if we still need the file(DOWNLOAD...) trick. It's a bit ugly... If we do need it, it'd have to be done from the CCP website (and can then be counted by Drupal) I think.

Kris Thielemans

unread,
Mar 2, 2018, 10:25:24 AM3/2/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

@casperdcl just merged a PR to be able to count github SIRF-Superbuild clones, subtracting travis ones. Great. @paskino counts VM downloads. Great. Are we counting docker downloads?
(In principle people can get the VM via vagrant etc, but I think this is a negligable minority, and that will create a SIRF-SuperBuild clone anyway, so we should be fine).

So are we done with this?

How do we get the relevant info? (can be manual as I said)

Casper da Costa-Luis

unread,
Mar 2, 2018, 10:35:52 AM3/2/18
to CCPPETMR/SIRF-SuperBuild, Subscribed
  • count superbuild clones properly (see github-stats#viewing)
  • count VM downloads (via drupal)
  • count docker pulls ()
    • TODO: subtract travis' docker pulls (or just estimate this from github-stats's decrements)

Casper da Costa-Luis

unread,
Mar 2, 2018, 1:41:40 PM3/2/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

@KrisThielemans we now have an automated badge! install-badge (it's in the README on https://github.com/CCPPETMR/SIRF-SuperBuild). Just waiting for @paskino to implement a JSON API for the vm downloads (CCPPETMR/github-stats#1)

Casper da Costa-Luis

unread,
Mar 2, 2018, 1:50:01 PM3/2/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

should be noted that every time we restart a job on travis (because e.g. it failed due to apt-get connections issues) then the counter will increment (because travis will have cloned the repo and then failed before we could decrement)

Casper da Costa-Luis

unread,
Mar 2, 2018, 2:04:25 PM3/2/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

just noticed travis osx fails due to insecure python, vis https://travis-ci.org/CCPPETMR/SIRF-SuperBuild/jobs/348359877#L2217. Not sure if this deserves a separate issue to resolve.

urllib2.URLError: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)>

Kris Thielemans

unread,
Mar 7, 2018, 10:50:04 AM3/7/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

@casperdcl this seems to be working great but the numbers are going up rather a lot. Is this realistic?

Casper da Costa-Luis

unread,
Mar 7, 2018, 11:10:34 AM3/7/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

Yes, I was going to mention this. The problem is (#93 (comment)) if travis fails before it gets to the counting code, then we have no way of knowing the travis clone should not be counted.

There's a semi-solution - github also provides "unique cloners" data (presumably based on IP addresses of cloners). If we use that instead, then we accept counting up to one extra clone per day due to travis builds (even then I should be able to negate that). It might be a better approach.

Kris Thielemans

unread,
Mar 7, 2018, 11:18:07 AM3/7/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

yes. I think it makes sense to call this "users" as opposed to downloads then. after all, if someone downloads it 5 times, we're not all that interested in knowing about this.

Casper da Costa-Luis

unread,
Mar 7, 2018, 6:59:24 PM3/7/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

hopefully better now

Casper da Costa-Luis

unread,
Mar 7, 2018, 7:02:54 PM3/7/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

it's displaying 707 now, but that may ne because of old overcounting. can easily add an offset, but let's see whether the number is still increasing rapidly first

Edoardo Pasca

unread,
Mar 7, 2018, 7:06:53 PM3/7/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

The VM got 38 downloads with 20 unique IPs. (basically 20 users).

Currently we are using a drupal plugin to count the downloads. Do we really want to implement a JSON API in drupal?

Casper da Costa-Luis

unread,
Mar 7, 2018, 7:09:35 PM3/7/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

you really just need to write out something like

{downloads: 20}

in a file www.ccppetmr.ac.uk/.../vm.json

Presumably easy?

Edoardo Pasca

unread,
Mar 7, 2018, 7:12:59 PM3/7/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

That I could do.

Casper da Costa-Luis

unread,
Mar 7, 2018, 7:14:37 PM3/7/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

cool. if you can Drupal to automatically do that then that's all we need.

Edoardo Pasca

unread,
Mar 8, 2018, 5:16:19 AM3/8/18
to CCPPETMR/SIRF-SuperBuild, Subscribed

No, I can put a Json file on the website. That drupal changes it, it is a totally different ball-game. And I've currently no clue how.

Reply all
Reply to author
Forward
0 new messages