Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes bug 1212088 - Expose graphics related CSV report via webapp #3027

Conversation

peterbe
Copy link
Contributor

@peterbe peterbe commented Oct 8, 2015

@AdrianGaudebert r?
cc @twobraids

I'd like to get some early eyes on this whilst I wait for the Graphics team to get back to me about which columns we can blanket out. E.g. adu_count.
Once we have the most expensive columns blanket'ed out (e.g. adu_count and duplicate_of) that query will become many many times faster.

How to test this? Run the branch and load http://socorro.dev/graphics_report/?date=2015-10-08 for example. Note that you need to be logged in.

How to test it on the command line...
First you need to generate an API token that has the "Run long queries" permission.
Then something like this:

curl -v -H "Auth-Token: 12312312312312312" http://socorro.dev/graphics_report/?date=2015-10-08

Or if you want to test that it gets gzipped properly, download it like this:

curl --compressed -v -H "Auth-Token: 12312312312312312" http://socorro.dev/graphics_report/?date=2015-10-08 > /tmp/reports.csv

And then you should be able open /tmp/reports.csv in Excel or Quip or Libreoffice or whatever you prefer.

@peterbe peterbe changed the title [DO NOT MERGE] fixes bug 1212088 - Expose graphics related CSV report via webapp fixes bug 1212088 - Expose graphics related CSV report via webapp Oct 8, 2015
@peterbe
Copy link
Contributor Author

peterbe commented Oct 9, 2015

@AdrianGaudebert Note in the last iteration that I put adu_count sub-select back in because they have stated that they need that.
I suspect that if we can change this query to reports_clean AND switch to using product_adi I think this query will perform a lot better.
Having said that, this URL will require a token and I've prepared the graphics team about that.

So, I suggest we land this (pending review of course!) and evaluate what to do once we see if this is hurting our PG.

@peterbe peterbe force-pushed the bug-1212088-expose-graphics-related-csv-report-via-webapp branch from 91affa2 to 0572464 Compare October 9, 2015 23:21
r.os_version, --11
r.cpu_name || ' | ' || r.cpu_info as cpu_info, --12
r.address, --13
ARRAY(SELECT 1 WHERE FALSE) as bug_list, --14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the doc, you can write ARRAY[] instead, but I haven't tested it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

breakpad=> select ARRAY[] As things;
ERROR:  cannot determine type of empty array
LINE 1: select ARRAY[] As things;
               ^
HINT:  Explicitly cast to the desired type, for example ARRAY[]::integer[].
breakpad=> select ARRAY(select 1 where false) As things;
 things
--------
 {}
(1 row)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried something like that first but it didn't work. The reason I ended up with ARRAY(SELECT 1 WHERE FALSE) was because I found some stackoverflow post that tried to answer the same question I think I had.

@adngdb
Copy link
Contributor

adngdb commented Oct 12, 2015

r+

@peterbe peterbe force-pushed the bug-1212088-expose-graphics-related-csv-report-via-webapp branch from 0572464 to 42e1073 Compare October 12, 2015 20:53
peterbe pushed a commit that referenced this pull request Oct 12, 2015
…ated-csv-report-via-webapp

fixes bug 1212088 - Expose graphics related CSV report via webapp
@peterbe peterbe merged commit 0f00ccc into mozilla-services:master Oct 12, 2015
@peterbe peterbe deleted the bug-1212088-expose-graphics-related-csv-report-via-webapp branch October 12, 2015 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants