Merge pull request #7489 from mohsen1/update-tracer

Update "chrome-trace-event" package and remove types
This commit is contained in:
Tobias Koppers 2018-06-07 17:44:26 +02:00 committed by GitHub
commit 47101fd603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 27 deletions

21
declarations.d.ts vendored
View File

@ -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(

View File

@ -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({
@ -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)

View File

@ -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",

View File

@ -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"
@ -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"