mozilla / probe-scraper

Scrape and publish Telemetry probe data from Firefox
https://mozilla.github.io/probe-scraper/
Mozilla Public License 2.0
22 stars 53 forks source link

Print some stats before saving probe data to disk #13

Open georgf opened 7 years ago

georgf commented 7 years ago

To make it more easy to judge whether things worked correctly etc., it would be great to print some basic stats before saving the outputs to disk in runner.py. E.g.:

sannanansari commented 6 years ago

I want to Work on this. You can guide me. This is my first bug.

Dexterp37 commented 6 years ago

Hey @sannanansari , hi and welcome!

One possible approach for doing this is the following:

Does this make sense?

sannanansari commented 6 years ago

Sorry for late. You can elaborate about 1st point.

georgf commented 6 years ago

revisions is a dictionary. We want to count the number of entries (or keys) in it (so we can later print it).

sannanansari commented 6 years ago

I am getting some error. ERROR:-- Unable to parse whitelist (C:\Users\Sannan Ansari\Documents\GitHub\probe-scraper\probe_scraper\parsers\third_party\histogram-whitelists.json). Assuming all histograms are acceptable. Traceback (most recent call last): File "runner.py", line 19, in from scrapers import git_scraper, moz_central_scraper File "C:\Users\Sannan Ansari\Documents\GitHub\probe-scraper\probe_scraper\scrapers\git_scraper.py", line 6, in from git import Repo File "C:\Python27\lib\site-packages\git__init__.py", line 85, in raise ImportError('Failed to initialize: {0}'.format(exc)) ImportError: Failed to initialize: Bad git executable. The git executable must be specified in one of the following ways:

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the $GIT_PYTHON_REFRESH environment variable. Use one of the following values:

Example: export GIT_PYTHON_REFRESH=quiet

georgf commented 6 years ago

The first part ("unable to parse whitelist") is just a warning and expected.

The second part about git is the important one. It sounds like you either 1) don't have git installed or 2) it's not in the path like pointed out in the message.

You could:

sannanansari commented 6 years ago

Their is no file name(histogram-whitelists.json). So, how can it take any file which is not their as input. What is a whitelist?

georgf commented 6 years ago

You can ignore that first part about "histogram-whitelists.json", it is expected and the code will run fine without this file. A whitelist is a general concept. Here it is used to allow some backward compability for only specific entries, but only when this is run when building Firefox. As mentioned, for this issue you don't need to worry about the whitelist.

sannanansari commented 6 years ago

I made a pull request You can review it.

sannanansari commented 6 years ago

https://github.com/sannanansari/probe-scraper/commit/dd26b344eef523c8a2cbfad5c15b4d132b917495

georgf commented 6 years ago

Ok, great. Can you do a pull request against this mozilla repository? You can read about the steps here.