Skip to content

Commit

Permalink
Merge pull request #7489 from mohsen1/update-tracer
Browse files Browse the repository at this point in the history
Update "chrome-trace-event" package and remove types
  • Loading branch information
sokra committed Jun 7, 2018
2 parents ebe90f4 + 48a1e51 commit 47101fd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 27 deletions.
21 changes: 0 additions & 21 deletions declarations.d.ts
Expand Up @@ -7,27 +7,6 @@ declare namespace NodeJS {
}
}

// There are no typings for chrome-trace-event
declare module "chrome-trace-event" {
interface Event {
name: string;
id?: number;
cat: string[];
args?: Object;
}

export class Tracer {
constructor(options: { noStream: boolean });
pipe(stream: NodeJS.WritableStream): void;
instantEvent(event: Event): void;
counter: number;
trace: {
begin(event: Event): void;
end(event: Event): void;
};
}
}

// There are no typings for @webassemblyjs/ast
declare module "@webassemblyjs/ast" {
export function traverse(
Expand Down
13 changes: 11 additions & 2 deletions lib/debug/ProfilingPlugin.js
Expand Up @@ -71,9 +71,18 @@ class Profiler {
}
}

/**
* @typedef {Object} Trace
* @description an object that wraps Tracer and Profiler with a counter
* @property {Tracer} trace instance of Tracer
* @property {number} counter Counter
* @property {Profiler} profiler instance of Profiler
* @property {Function} end the end function
*/

/**
* @param {string} outputPath The location where to write the log.
* @returns {{trace: ?, counter: number, profiler: Profiler, end: Function}} The trace object
* @returns {Trace} The trace object
*/
function createTrace(outputPath) {
const trace = new Tracer({
Expand Down Expand Up @@ -325,7 +334,7 @@ const makeInterceptorFor = (instance, tracer) => hookName => ({

/**
* @param {string} hookName Name of the hook to profile.
* @param {Tracer} tracer Instance of tracer.
* @param {Trace} tracer The trace object.
* @param {object} options Options for the profiled fn.
* @param {string} options.name Plugin name
* @param {string} options.type Plugin type (sync | async | promise)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -14,7 +14,7 @@
"acorn-dynamic-import": "^3.0.0",
"ajv": "^6.1.0",
"ajv-keywords": "^3.1.0",
"chrome-trace-event": "^0.1.1",
"chrome-trace-event": "^1.0.0",
"enhanced-resolve": "^4.0.0",
"eslint-scope": "^3.7.1",
"json-parse-better-errors": "^1.0.2",
Expand Down
12 changes: 9 additions & 3 deletions yarn.lock
Expand Up @@ -992,9 +992,11 @@ chownr@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181"

chrome-trace-event@^0.1.1:
version "0.1.3"
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-0.1.3.tgz#d395af2d31c87b90a716c831fe326f69768ec084"
chrome-trace-event@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz#45a91bd2c20c9411f0963b5aaeb9a1b95e09cc48"
dependencies:
tslib "^1.9.0"

ci-info@^1.0.0:
version "1.1.3"
Expand Down Expand Up @@ -5950,6 +5952,10 @@ trim-right@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"

tslib@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"

tty-browserify@0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
Expand Down

0 comments on commit 47101fd

Please sign in to comment.