Created
August 4, 2017 03:10
-
-
Save cvazac/01fda820a9bbfeba1c9409f43cae7432 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const query = ` | |
| CREATE TEMPORARY FUNCTION getHeaders(payload STRING) | |
| RETURNS STRING | |
| LANGUAGE js AS """ | |
| try { | |
| var $ = JSON.parse(payload); | |
| var headers = $.response.headers; | |
| var st = headers.find(function(e) { | |
| return e['name'].toLowerCase() === 'server-timing' | |
| }); | |
| return st['value']; | |
| } catch (e) { | |
| return ''; | |
| } | |
| """; | |
| SELECT * FROM | |
| (SELECT url, getHeaders(payload) AS st FROM httparchive.har.2017_07_01_chrome_requests) | |
| WHERE | |
| st != "" | |
| ` | |
| ReactDOM.render( | |
| <HttpArchiveQuery query={query}><div>Hello, world</div></HttpArchiveQuery>, | |
| document.getElementById('root') | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment