Skip to content

Instantly share code, notes, and snippets.

View deepanjanroy's full-sized avatar

Deepanjan Roy deepanjanroy

  • Google
  • Kitchener, ON, Canada
View GitHub Profile
@deepanjanroy
deepanjanroy / cpu_core_metric.proto
Created February 3, 2020 18:41
cpu_core_metric
// Copyright 2019 Google LLC.
// SPDX-License-Identifier: Apache-2.0
syntax = "proto2";
package perfetto.protos;
import "protos/perfetto/metrics/metrics.proto";
// TODO: Ideally we won't need this second import.
import "protos/perfetto/metrics/custom_options.proto";
@deepanjanroy
deepanjanroy / console_error_metric.proto
Created January 15, 2020 20:35
proto annotations example
// Copyright 2019 Google LLC.
// SPDX-License-Identifier: Apache-2.0
syntax = "proto2";
package perfetto.protos;
import "protos/perfetto/metrics/metrics.proto";
// TODO(dproy): This second import is unfortunate. How can we get rid of this?
import "protos/perfetto/metrics/custom_options.proto";
// Copyright 2019 Google LLC.
// SPDX-License-Identifier: Apache-2.0
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package perfetto.protos;
import "perfetto/metrics/metrics.proto";
@deepanjanroy
deepanjanroy / tti-companion-config.js
Last active July 25, 2019 17:55
Lighthouse config for running TTI Companion Metric.
/**
* @license Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';
/** @type {LH.Config.Json} */
const config = {
extends: 'lighthouse:default',
diff --git a/brush-timeline.js b/brush-timeline.js
index 307a3c2..165c162 100644
--- a/brush-timeline.js
+++ b/brush-timeline.js
@@ -137,6 +137,11 @@ class BrushTimeline extends HTMLElement {
this.setAttribute('end', end);
this.updateVis();
}
+
+ logAndUpdateEnd(end) {
@deepanjanroy
deepanjanroy / README.md
Last active May 11, 2018 15:12
TimelineTrace

Timeline traces here.

@deepanjanroy
deepanjanroy / main.js
Last active April 6, 2018 20:28
TTI Test
function main() {
console.log("Running");
const confirmDiv = document.getElementById("didRunScript");
const taskStart = performance.now();
while(performance.now() < taskStart + 1000);
confirmDiv.innerText = "Ran Script";
}
document.addEventListener('DOMContentLoaded', function(){
setTimeout(main, 0);
@deepanjanroy
deepanjanroy / README.md
Last active February 7, 2018 15:56
Long Task attributions top urls

This gist accompanies The long task attribution doc

Notes:

  • We only pick the hostnames for the URLs. Getting the full URL did not produce meanigful result.
  • None means the v8 function call task did not have an url with a valid hostname. The vast majority of the time this happens because the URL is empty.
    • It is not clear why the url is empty for some v8 function calls, but one guess is this happens when the script is embedded in the main html page.
  • We limit to top 100 for all lists.
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head i18n-values="dir:textdirection;">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>https://h5.m.taobao.com/</title>
<!--
Polymer is imported through third-party HTML files, which means that we have to
manually list all recursive imports.
--><dom-module id="tr-ui-a-analysis-link">
<template>
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head i18n-values="dir:textdirection;">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>https://h5.m.taobao.com/</title>
<!--
Polymer is imported through third-party HTML files, which means that we have to
manually list all recursive imports.
--><dom-module id="tr-ui-a-analysis-link">
<template>