Skip to content

Instantly share code, notes, and snippets.

@cvazac
Created Aug 4, 2017
Embed
What would you like to do?
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