repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/linux_perf/ftrace_importer.js | function(timeShift) {
this.forEachLine(function(text, eventBase, cpuNumber, pid, ts) {
var eventName = eventBase.eventName;
var handler = this.eventHandlers_[eventName];
if (!handler) {
this.model_.importWarning({
type: 'parse_error',
message: 'Unknown eve... | javascript | function(timeShift) {
this.forEachLine(function(text, eventBase, cpuNumber, pid, ts) {
var eventName = eventBase.eventName;
var handler = this.eventHandlers_[eventName];
if (!handler) {
this.model_.importWarning({
type: 'parse_error',
message: 'Unknown eve... | [
"function",
"(",
"timeShift",
")",
"{",
"this",
".",
"forEachLine",
"(",
"function",
"(",
"text",
",",
"eventBase",
",",
"cpuNumber",
",",
"pid",
",",
"ts",
")",
"{",
"var",
"eventName",
"=",
"eventBase",
".",
"eventName",
";",
"var",
"handler",
"=",
"... | Walks the this.events_ structure and creates Cpu objects. | [
"Walks",
"the",
"this",
".",
"events_",
"structure",
"and",
"creates",
"Cpu",
"objects",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/linux_perf/ftrace_importer.js#L838-L857 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/linux_perf/ftrace_importer.js | function() {
var lines = [];
var extractResult = LinuxPerfImporter._extractEventsFromSystraceHTML(
this.events_, true);
if (!extractResult.ok)
extractResult = LinuxPerfImporter._extractEventsFromSystraceMultiHTML(
this.events_, true);
var lines = extractResult.ok ?
... | javascript | function() {
var lines = [];
var extractResult = LinuxPerfImporter._extractEventsFromSystraceHTML(
this.events_, true);
if (!extractResult.ok)
extractResult = LinuxPerfImporter._extractEventsFromSystraceMultiHTML(
this.events_, true);
var lines = extractResult.ok ?
... | [
"function",
"(",
")",
"{",
"var",
"lines",
"=",
"[",
"]",
";",
"var",
"extractResult",
"=",
"LinuxPerfImporter",
".",
"_extractEventsFromSystraceHTML",
"(",
"this",
".",
"events_",
",",
"true",
")",
";",
"if",
"(",
"!",
"extractResult",
".",
"ok",
")",
"... | Walks the this.events_ structure and populates this.lines_. | [
"Walks",
"the",
"this",
".",
"events_",
"structure",
"and",
"populates",
"this",
".",
"lines_",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/linux_perf/ftrace_importer.js#L862-L904 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/linux_perf/ftrace_importer.js | function(handler) {
for (var i = 0; i < this.lines_.length; ++i) {
var line = this.lines_[i];
handler.apply(this, line);
}
} | javascript | function(handler) {
for (var i = 0; i < this.lines_.length; ++i) {
var line = this.lines_[i];
handler.apply(this, line);
}
} | [
"function",
"(",
"handler",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"lines_",
".",
"length",
";",
"++",
"i",
")",
"{",
"var",
"line",
"=",
"this",
".",
"lines_",
"[",
"i",
"]",
";",
"handler",
".",
"apply",
"("... | Calls |handler| for every parsed line. | [
"Calls",
"|handler|",
"for",
"every",
"parsed",
"line",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/linux_perf/ftrace_importer.js#L909-L914 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/cpu.js | Cpu | function Cpu(kernel, number) {
if (kernel === undefined || number === undefined)
throw new Error('Missing arguments');
this.kernel = kernel;
this.cpuNumber = number;
this.slices = [];
this.counters = {};
this.bounds = new tr.b.Range();
this.samples_ = undefined; // Set during createSub... | javascript | function Cpu(kernel, number) {
if (kernel === undefined || number === undefined)
throw new Error('Missing arguments');
this.kernel = kernel;
this.cpuNumber = number;
this.slices = [];
this.counters = {};
this.bounds = new tr.b.Range();
this.samples_ = undefined; // Set during createSub... | [
"function",
"Cpu",
"(",
"kernel",
",",
"number",
")",
"{",
"if",
"(",
"kernel",
"===",
"undefined",
"||",
"number",
"===",
"undefined",
")",
"throw",
"new",
"Error",
"(",
"'Missing arguments'",
")",
";",
"this",
".",
"kernel",
"=",
"kernel",
";",
"this",... | The Cpu represents a Cpu from the kernel's point of view.
@constructor | [
"The",
"Cpu",
"represents",
"a",
"Cpu",
"from",
"the",
"kernel",
"s",
"point",
"of",
"view",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/cpu.js#L28-L48 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/cpu.js | function(amount) {
for (var sI = 0; sI < this.slices.length; sI++)
this.slices[sI].start = (this.slices[sI].start + amount);
for (var id in this.counters)
this.counters[id].shiftTimestampsForward(amount);
} | javascript | function(amount) {
for (var sI = 0; sI < this.slices.length; sI++)
this.slices[sI].start = (this.slices[sI].start + amount);
for (var id in this.counters)
this.counters[id].shiftTimestampsForward(amount);
} | [
"function",
"(",
"amount",
")",
"{",
"for",
"(",
"var",
"sI",
"=",
"0",
";",
"sI",
"<",
"this",
".",
"slices",
".",
"length",
";",
"sI",
"++",
")",
"this",
".",
"slices",
"[",
"sI",
"]",
".",
"start",
"=",
"(",
"this",
".",
"slices",
"[",
"sI... | Shifts all the timestamps inside this CPU forward by the amount
specified. | [
"Shifts",
"all",
"the",
"timestamps",
"inside",
"this",
"CPU",
"forward",
"by",
"the",
"amount",
"specified",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/cpu.js#L101-L106 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/cpu.js | function() {
this.bounds.reset();
if (this.slices.length) {
this.bounds.addValue(this.slices[0].start);
this.bounds.addValue(this.slices[this.slices.length - 1].end);
}
for (var id in this.counters) {
this.counters[id].updateBounds();
this.bounds.addRange(this.cou... | javascript | function() {
this.bounds.reset();
if (this.slices.length) {
this.bounds.addValue(this.slices[0].start);
this.bounds.addValue(this.slices[this.slices.length - 1].end);
}
for (var id in this.counters) {
this.counters[id].updateBounds();
this.bounds.addRange(this.cou... | [
"function",
"(",
")",
"{",
"this",
".",
"bounds",
".",
"reset",
"(",
")",
";",
"if",
"(",
"this",
".",
"slices",
".",
"length",
")",
"{",
"this",
".",
"bounds",
".",
"addValue",
"(",
"this",
".",
"slices",
"[",
"0",
"]",
".",
"start",
")",
";",... | Updates the range based on the current slices attached to the cpu. | [
"Updates",
"the",
"range",
"based",
"on",
"the",
"current",
"slices",
"attached",
"to",
"the",
"cpu",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/cpu.js#L111-L126 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/cpu.js | function(end_timestamp, args) {
// Don't generate a slice if the last active thread is the idle task.
if (this.lastActiveThread_ == undefined || this.lastActiveThread_ == 0)
return;
if (end_timestamp < this.lastActiveTimestamp_) {
throw new Error('The end timestamp of a thread running... | javascript | function(end_timestamp, args) {
// Don't generate a slice if the last active thread is the idle task.
if (this.lastActiveThread_ == undefined || this.lastActiveThread_ == 0)
return;
if (end_timestamp < this.lastActiveTimestamp_) {
throw new Error('The end timestamp of a thread running... | [
"function",
"(",
"end_timestamp",
",",
"args",
")",
"{",
"// Don't generate a slice if the last active thread is the idle task.",
"if",
"(",
"this",
".",
"lastActiveThread_",
"==",
"undefined",
"||",
"this",
".",
"lastActiveThread_",
"==",
"0",
")",
"return",
";",
"if... | Closes the thread running on the CPU. |end_timestamp| is the timestamp
at which the thread was unscheduled. |args| is merged with the arguments
specified when the thread was initially scheduled. | [
"Closes",
"the",
"thread",
"running",
"on",
"the",
"CPU",
".",
"|end_timestamp|",
"is",
"the",
"timestamp",
"at",
"which",
"the",
"thread",
"was",
"unscheduled",
".",
"|args|",
"is",
"merged",
"with",
"the",
"arguments",
"specified",
"when",
"the",
"thread",
... | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/cpu.js#L163-L194 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/cpu.js | function(range) {
var stats = {};
function addStatsForFreq(freqSample, index) {
// Counters don't have an explicit end or duration;
// calculate the end by looking at the starting point
// of the next value in the series, or if that doesn't
// exist, assume this frequency is... | javascript | function(range) {
var stats = {};
function addStatsForFreq(freqSample, index) {
// Counters don't have an explicit end or duration;
// calculate the end by looking at the starting point
// of the next value in the series, or if that doesn't
// exist, assume this frequency is... | [
"function",
"(",
"range",
")",
"{",
"var",
"stats",
"=",
"{",
"}",
";",
"function",
"addStatsForFreq",
"(",
"freqSample",
",",
"index",
")",
"{",
"// Counters don't have an explicit end or duration;",
"// calculate the end by looking at the starting point",
"// of the next ... | Returns the frequency statistics for this CPU;
the returned object contains the frequencies as keys,
and the duration at this frequency in milliseconds as the value,
for the range that was specified. | [
"Returns",
"the",
"frequency",
"statistics",
"for",
"this",
"CPU",
";",
"the",
"returned",
"object",
"contains",
"the",
"frequencies",
"as",
"keys",
"and",
"the",
"duration",
"at",
"this",
"frequency",
"in",
"milliseconds",
"as",
"the",
"value",
"for",
"the",
... | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/cpu.js#L214-L250 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/flow_event.js | FlowEvent | function FlowEvent(category, id, title, colorId, start, args, opt_duration) {
tr.model.TimedEvent.call(this, start);
this.category = category || '';
this.title = title;
this.colorId = colorId;
this.start = start;
this.args = args;
this.id = id;
this.startSlice = undefined;
this.en... | javascript | function FlowEvent(category, id, title, colorId, start, args, opt_duration) {
tr.model.TimedEvent.call(this, start);
this.category = category || '';
this.title = title;
this.colorId = colorId;
this.start = start;
this.args = args;
this.id = id;
this.startSlice = undefined;
this.en... | [
"function",
"FlowEvent",
"(",
"category",
",",
"id",
",",
"title",
",",
"colorId",
",",
"start",
",",
"args",
",",
"opt_duration",
")",
"{",
"tr",
".",
"model",
".",
"TimedEvent",
".",
"call",
"(",
"this",
",",
"start",
")",
";",
"this",
".",
"catego... | A Flow represents an interval of time plus parameters associated
with that interval.
@constructor | [
"A",
"Flow",
"represents",
"an",
"interval",
"of",
"time",
"plus",
"parameters",
"associated",
"with",
"that",
"interval",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/flow_event.js#L22-L41 | train |
googlearchive/node-big-rig | lib/third_party/tracing/base/event.js | dispatchSimpleEvent | function dispatchSimpleEvent(target, type, opt_bubbles, opt_cancelable) {
var e = new tr.b.Event(type, opt_bubbles, opt_cancelable);
return target.dispatchEvent(e);
} | javascript | function dispatchSimpleEvent(target, type, opt_bubbles, opt_cancelable) {
var e = new tr.b.Event(type, opt_bubbles, opt_cancelable);
return target.dispatchEvent(e);
} | [
"function",
"dispatchSimpleEvent",
"(",
"target",
",",
"type",
",",
"opt_bubbles",
",",
"opt_cancelable",
")",
"{",
"var",
"e",
"=",
"new",
"tr",
".",
"b",
".",
"Event",
"(",
"type",
",",
"opt_bubbles",
",",
"opt_cancelable",
")",
";",
"return",
"target",
... | Dispatches a simple event on an event target.
@param {!EventTarget} target The event target to dispatch the event on.
@param {string} type The type of the event.
@param {boolean=} opt_bubbles Whether the event bubbles or not.
@param {boolean=} opt_cancelable Whether the default action of the event
can be prevented.
@re... | [
"Dispatches",
"a",
"simple",
"event",
"on",
"an",
"event",
"target",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/base/event.js#L81-L84 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/cpu_slice.js | CpuSlice | function CpuSlice(cat, title, colorId, start, args, opt_duration) {
Slice.apply(this, arguments);
this.threadThatWasRunning = undefined;
this.cpu = undefined;
} | javascript | function CpuSlice(cat, title, colorId, start, args, opt_duration) {
Slice.apply(this, arguments);
this.threadThatWasRunning = undefined;
this.cpu = undefined;
} | [
"function",
"CpuSlice",
"(",
"cat",
",",
"title",
",",
"colorId",
",",
"start",
",",
"args",
",",
"opt_duration",
")",
"{",
"Slice",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"this",
".",
"threadThatWasRunning",
"=",
"undefined",
";",
"this"... | A CpuSlice represents a slice of time on a CPU.
@constructor | [
"A",
"CpuSlice",
"represents",
"a",
"slice",
"of",
"time",
"on",
"a",
"CPU",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/cpu_slice.js#L24-L28 | train |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/linux_perf/mali_parser.js | function(line) {
// Matches Mali perf events with thread info
var lineREWithThread =
/^\s*\(([\w\-]*)\)\s*(\w+):\s*([\w\\\/\.\-]*@\d*):?\s*(.*)$/;
if (lineREWithThread.test(line))
return lineREWithThread;
// Matches old-style Mali perf events
var lineRENoThread = /^s*()(... | javascript | function(line) {
// Matches Mali perf events with thread info
var lineREWithThread =
/^\s*\(([\w\-]*)\)\s*(\w+):\s*([\w\\\/\.\-]*@\d*):?\s*(.*)$/;
if (lineREWithThread.test(line))
return lineREWithThread;
// Matches old-style Mali perf events
var lineRENoThread = /^s*()(... | [
"function",
"(",
"line",
")",
"{",
"// Matches Mali perf events with thread info",
"var",
"lineREWithThread",
"=",
"/",
"^\\s*\\(([\\w\\-]*)\\)\\s*(\\w+):\\s*([\\w\\\\\\/\\.\\-]*@\\d*):?\\s*(.*)$",
"/",
";",
"if",
"(",
"lineREWithThread",
".",
"test",
"(",
"line",
")",
")",... | Deduce the format of Mali perf events.
@return {RegExp} the regular expression for parsing data when the format
is recognized; otherwise null. | [
"Deduce",
"the",
"format",
"of",
"Mali",
"perf",
"events",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/linux_perf/mali_parser.js#L249-L261 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/event_set.js | EventSet | function EventSet(opt_events) {
this.bounds_dirty_ = true;
this.bounds_ = new tr.b.Range();
this.length_ = 0;
this.guid_ = tr.b.GUID.allocate();
this.pushed_guids_ = {};
if (opt_events) {
if (opt_events instanceof Array) {
for (var i = 0; i < opt_events.length; i++)
this... | javascript | function EventSet(opt_events) {
this.bounds_dirty_ = true;
this.bounds_ = new tr.b.Range();
this.length_ = 0;
this.guid_ = tr.b.GUID.allocate();
this.pushed_guids_ = {};
if (opt_events) {
if (opt_events instanceof Array) {
for (var i = 0; i < opt_events.length; i++)
this... | [
"function",
"EventSet",
"(",
"opt_events",
")",
"{",
"this",
".",
"bounds_dirty_",
"=",
"true",
";",
"this",
".",
"bounds_",
"=",
"new",
"tr",
".",
"b",
".",
"Range",
"(",
")",
";",
"this",
".",
"length_",
"=",
"0",
";",
"this",
".",
"guid_",
"=",
... | Represents a event set within a and its associated set of tracks.
@constructor | [
"Represents",
"a",
"event",
"set",
"within",
"a",
"and",
"its",
"associated",
"set",
"of",
"tracks",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/event_set.js#L26-L43 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/event_set.js | function(event) {
if (event.guid == undefined)
throw new Error('Event must have a GUID');
if (this.contains(event))
return event;
this.pushed_guids_[event.guid] = true;
this[this.length_++] = event;
this.bounds_dirty_ = true;
return event;
} | javascript | function(event) {
if (event.guid == undefined)
throw new Error('Event must have a GUID');
if (this.contains(event))
return event;
this.pushed_guids_[event.guid] = true;
this[this.length_++] = event;
this.bounds_dirty_ = true;
return event;
} | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"event",
".",
"guid",
"==",
"undefined",
")",
"throw",
"new",
"Error",
"(",
"'Event must have a GUID'",
")",
";",
"if",
"(",
"this",
".",
"contains",
"(",
"event",
")",
")",
"return",
"event",
";",
"this",... | push pushes only unique events. If an event has been already pushed, do nothing. | [
"push",
"pushes",
"only",
"unique",
"events",
".",
"If",
"an",
"event",
"has",
"been",
"already",
"pushed",
"do",
"nothing",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/event_set.js#L80-L91 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/counter_series.js | CounterSeries | function CounterSeries(name, color) {
tr.model.EventContainer.call(this);
this.name_ = name;
this.color_ = color;
this.timestamps_ = [];
this.samples_ = [];
// Set by counter.addSeries
this.counter = undefined;
this.seriesIndex = undefined;
} | javascript | function CounterSeries(name, color) {
tr.model.EventContainer.call(this);
this.name_ = name;
this.color_ = color;
this.timestamps_ = [];
this.samples_ = [];
// Set by counter.addSeries
this.counter = undefined;
this.seriesIndex = undefined;
} | [
"function",
"CounterSeries",
"(",
"name",
",",
"color",
")",
"{",
"tr",
".",
"model",
".",
"EventContainer",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"name_",
"=",
"name",
";",
"this",
".",
"color_",
"=",
"color",
";",
"this",
".",
"timestamp... | A container holding all samples of a given measurement over time.
As an example, a counter series might measure the throughput of data sent
over a USB connection, with each sample representing the instantaneous
throughput of the connection.
@constructor
@extends {EventContainer} | [
"A",
"container",
"holding",
"all",
"samples",
"of",
"a",
"given",
"measurement",
"over",
"time",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/counter_series.js#L25-L37 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/model.js | function(callback) {
this.kernel.iterateAllPersistableObjects(callback);
for (var pid in this.processes)
this.processes[pid].iterateAllPersistableObjects(callback);
} | javascript | function(callback) {
this.kernel.iterateAllPersistableObjects(callback);
for (var pid in this.processes)
this.processes[pid].iterateAllPersistableObjects(callback);
} | [
"function",
"(",
"callback",
")",
"{",
"this",
".",
"kernel",
".",
"iterateAllPersistableObjects",
"(",
"callback",
")",
";",
"for",
"(",
"var",
"pid",
"in",
"this",
".",
"processes",
")",
"this",
".",
"processes",
"[",
"pid",
"]",
".",
"iterateAllPersista... | Some objects in the model can persist their state in ModelSettings.
This iterates through them. | [
"Some",
"objects",
"in",
"the",
"model",
"can",
"persist",
"their",
"state",
"in",
"ModelSettings",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/model.js#L145-L149 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/model.js | function() {
var categoriesDict = {};
this.device.addCategoriesToDict(categoriesDict);
this.kernel.addCategoriesToDict(categoriesDict);
for (var pid in this.processes)
this.processes[pid].addCategoriesToDict(categoriesDict);
this.categories = [];
for (var category in categor... | javascript | function() {
var categoriesDict = {};
this.device.addCategoriesToDict(categoriesDict);
this.kernel.addCategoriesToDict(categoriesDict);
for (var pid in this.processes)
this.processes[pid].addCategoriesToDict(categoriesDict);
this.categories = [];
for (var category in categor... | [
"function",
"(",
")",
"{",
"var",
"categoriesDict",
"=",
"{",
"}",
";",
"this",
".",
"device",
".",
"addCategoriesToDict",
"(",
"categoriesDict",
")",
";",
"this",
".",
"kernel",
".",
"addCategoriesToDict",
"(",
"categoriesDict",
")",
";",
"for",
"(",
"var... | Generates the set of categories from the slices and counters. | [
"Generates",
"the",
"set",
"of",
"categories",
"from",
"the",
"slices",
"and",
"counters",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/model.js#L237-L248 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/model.js | function(event) {
for (var i = 0; i < this.userFriendlyCategoryDrivers_.length; i++) {
var ufc = this.userFriendlyCategoryDrivers_[i].fromEvent(event);
if (ufc !== undefined)
return ufc;
}
return undefined;
} | javascript | function(event) {
for (var i = 0; i < this.userFriendlyCategoryDrivers_.length; i++) {
var ufc = this.userFriendlyCategoryDrivers_[i].fromEvent(event);
if (ufc !== undefined)
return ufc;
}
return undefined;
} | [
"function",
"(",
"event",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"userFriendlyCategoryDrivers_",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"ufc",
"=",
"this",
".",
"userFriendlyCategoryDrivers_",
"[",
"i",
"]",
... | Gets the user friendly category string from an event.
Returns undefined if none is known. | [
"Gets",
"the",
"user",
"friendly",
"category",
"string",
"from",
"an",
"event",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/model.js#L323-L330 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/model.js | function(data) {
data.showToUser = !!data.showToUser;
this.importWarnings_.push(data);
// Only log each warning type once. We may want to add some kind of
// flag to allow reporting all importer warnings.
if (this.reportedImportWarnings_[data.type] === true)
return;
if (th... | javascript | function(data) {
data.showToUser = !!data.showToUser;
this.importWarnings_.push(data);
// Only log each warning type once. We may want to add some kind of
// flag to allow reporting all importer warnings.
if (this.reportedImportWarnings_[data.type] === true)
return;
if (th... | [
"function",
"(",
"data",
")",
"{",
"data",
".",
"showToUser",
"=",
"!",
"!",
"data",
".",
"showToUser",
";",
"this",
".",
"importWarnings_",
".",
"push",
"(",
"data",
")",
";",
"// Only log each warning type once. We may want to add some kind of",
"// flag to allow ... | Saves a warning that happened during import.
Warnings are typically logged to the console, and optionally, the
more critical ones are shown to the user.
@param {Object} data The import warning data. Data must provide two
accessors: type, message. The types are used to determine if we
should output the message, we'll ... | [
"Saves",
"a",
"warning",
"that",
"happened",
"during",
"import",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/model.js#L396-L410 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/sample.js | Sample | function Sample(cpu, thread, title, start, leafStackFrame,
opt_weight, opt_args) {
tr.model.TimedEvent.call(this, start);
this.title = title;
this.cpu = cpu;
this.thread = thread;
this.leafStackFrame = leafStackFrame;
this.weight = opt_weight;
this.args = opt_args || {};
... | javascript | function Sample(cpu, thread, title, start, leafStackFrame,
opt_weight, opt_args) {
tr.model.TimedEvent.call(this, start);
this.title = title;
this.cpu = cpu;
this.thread = thread;
this.leafStackFrame = leafStackFrame;
this.weight = opt_weight;
this.args = opt_args || {};
... | [
"function",
"Sample",
"(",
"cpu",
",",
"thread",
",",
"title",
",",
"start",
",",
"leafStackFrame",
",",
"opt_weight",
",",
"opt_args",
")",
"{",
"tr",
".",
"model",
".",
"TimedEvent",
".",
"call",
"(",
"this",
",",
"start",
")",
";",
"this",
".",
"t... | A Sample represents a sample taken at an instant in time, plus its stack
frame and parameters associated with that sample.
@constructor | [
"A",
"Sample",
"represents",
"a",
"sample",
"taken",
"at",
"an",
"instant",
"in",
"time",
"plus",
"its",
"stack",
"frame",
"and",
"parameters",
"associated",
"with",
"that",
"sample",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/sample.js#L22-L32 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/object_snapshot.js | ObjectSnapshot | function ObjectSnapshot(objectInstance, ts, args) {
tr.model.Event.call(this);
this.objectInstance = objectInstance;
this.ts = ts;
this.args = args;
} | javascript | function ObjectSnapshot(objectInstance, ts, args) {
tr.model.Event.call(this);
this.objectInstance = objectInstance;
this.ts = ts;
this.args = args;
} | [
"function",
"ObjectSnapshot",
"(",
"objectInstance",
",",
"ts",
",",
"args",
")",
"{",
"tr",
".",
"model",
".",
"Event",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"objectInstance",
"=",
"objectInstance",
";",
"this",
".",
"ts",
"=",
"ts",
";",
... | A snapshot of an object instance, at a given moment in time.
Initialization of snapshots and instances is three phased:
1. Instances and snapshots are constructed. This happens during event
importing. Little should be done here, because the object's data
are still being used by the importer to reconstruct object refe... | [
"A",
"snapshot",
"of",
"an",
"object",
"instance",
"at",
"a",
"given",
"moment",
"in",
"time",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/object_snapshot.js#L36-L41 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/power_series.js | function(ts, val) {
var sample = new PowerSample(this, ts, val);
this.samples_.push(sample);
return sample;
} | javascript | function(ts, val) {
var sample = new PowerSample(this, ts, val);
this.samples_.push(sample);
return sample;
} | [
"function",
"(",
"ts",
",",
"val",
")",
"{",
"var",
"sample",
"=",
"new",
"PowerSample",
"(",
"this",
",",
"ts",
",",
"val",
")",
";",
"this",
".",
"samples_",
".",
"push",
"(",
"sample",
")",
";",
"return",
"sample",
";",
"}"
] | Adds a power sample to the series and returns it.
Note: Samples must be added in chronological order. | [
"Adds",
"a",
"power",
"sample",
"to",
"the",
"series",
"and",
"returns",
"it",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/power_series.js#L50-L54 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/device.js | Device | function Device(model) {
if (!model)
throw new Error('Must provide a model.');
tr.model.EventContainer.call(this);
this.powerSeries_ = undefined;
this.vSyncTimestamps_ = [];
} | javascript | function Device(model) {
if (!model)
throw new Error('Must provide a model.');
tr.model.EventContainer.call(this);
this.powerSeries_ = undefined;
this.vSyncTimestamps_ = [];
} | [
"function",
"Device",
"(",
"model",
")",
"{",
"if",
"(",
"!",
"model",
")",
"throw",
"new",
"Error",
"(",
"'Must provide a model.'",
")",
";",
"tr",
".",
"model",
".",
"EventContainer",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"powerSeries_",
"... | Device represents the device-level objects in the model.
@constructor
@extends {tr.model.EventContainer} | [
"Device",
"represents",
"the",
"device",
"-",
"level",
"objects",
"in",
"the",
"model",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/device.js#L24-L32 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice.js | Slice | function Slice(category, title, colorId, start, args, opt_duration,
opt_cpuStart, opt_cpuDuration, opt_argsStripped,
opt_bind_id) {
tr.model.TimedEvent.call(this, start);
this.category = category || '';
this.title = title;
this.colorId = colorId;
this.args = args;
... | javascript | function Slice(category, title, colorId, start, args, opt_duration,
opt_cpuStart, opt_cpuDuration, opt_argsStripped,
opt_bind_id) {
tr.model.TimedEvent.call(this, start);
this.category = category || '';
this.title = title;
this.colorId = colorId;
this.args = args;
... | [
"function",
"Slice",
"(",
"category",
",",
"title",
",",
"colorId",
",",
"start",
",",
"args",
",",
"opt_duration",
",",
"opt_cpuStart",
",",
"opt_cpuDuration",
",",
"opt_argsStripped",
",",
"opt_bind_id",
")",
"{",
"tr",
".",
"model",
".",
"TimedEvent",
"."... | A Slice represents an interval of time plus parameters associated
with that interval.
@constructor | [
"A",
"Slice",
"represents",
"an",
"interval",
"of",
"time",
"plus",
"parameters",
"associated",
"with",
"that",
"interval",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice.js#L22-L62 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice.js | function(callback, opt_this) {
var parentStack = [];
var started = false;
// get the root node and push it to the DFS stack
var topmostSlice = this.mostTopLevelSlice;
parentStack.push(topmostSlice);
// Using the stack to perform DFS
while (parentStack.length !== 0) {
... | javascript | function(callback, opt_this) {
var parentStack = [];
var started = false;
// get the root node and push it to the DFS stack
var topmostSlice = this.mostTopLevelSlice;
parentStack.push(topmostSlice);
// Using the stack to perform DFS
while (parentStack.length !== 0) {
... | [
"function",
"(",
"callback",
",",
"opt_this",
")",
"{",
"var",
"parentStack",
"=",
"[",
"]",
";",
"var",
"started",
"=",
"false",
";",
"// get the root node and push it to the DFS stack",
"var",
"topmostSlice",
"=",
"this",
".",
"mostTopLevelSlice",
";",
"parentSt... | Obtains all subsequent slices of this slice.
Subsequent slices are slices that get executed after a particular
slice, i.e., all the functions that are called after the current one.
For instance, E.iterateAllSubsequentSlices() in the following example:
[ A ]
[ B][ D ][ G ]
[C] [E][F] [H]
will pass F,... | [
"Obtains",
"all",
"subsequent",
"slices",
"of",
"this",
"slice",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice.js#L140-L161 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice.js | function(callback, opt_this) {
var curSlice = this;
while (curSlice.parentSlice) {
curSlice = curSlice.parentSlice;
callback.call(opt_this, curSlice);
}
} | javascript | function(callback, opt_this) {
var curSlice = this;
while (curSlice.parentSlice) {
curSlice = curSlice.parentSlice;
callback.call(opt_this, curSlice);
}
} | [
"function",
"(",
"callback",
",",
"opt_this",
")",
"{",
"var",
"curSlice",
"=",
"this",
";",
"while",
"(",
"curSlice",
".",
"parentSlice",
")",
"{",
"curSlice",
"=",
"curSlice",
".",
"parentSlice",
";",
"callback",
".",
"call",
"(",
"opt_this",
",",
"cur... | Obtains the parents of a slice, from the most immediate to the root.
For instance, E.iterateAllAncestors() in the following example:
[ A ]
[ B][ D ][ G ]
[C] [E][F] [H]
will pass D, then A to the provided callback, in the order from the
leaves to the root. | [
"Obtains",
"the",
"parents",
"of",
"a",
"slice",
"from",
"the",
"most",
"immediate",
"to",
"the",
"root",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice.js#L183-L190 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice_group.js | function(slice) {
this.haveTopLevelSlicesBeenBuilt = false;
slice.parentContainer = this.parentContainer_;
this.slices.push(slice);
return slice;
} | javascript | function(slice) {
this.haveTopLevelSlicesBeenBuilt = false;
slice.parentContainer = this.parentContainer_;
this.slices.push(slice);
return slice;
} | [
"function",
"(",
"slice",
")",
"{",
"this",
".",
"haveTopLevelSlicesBeenBuilt",
"=",
"false",
";",
"slice",
".",
"parentContainer",
"=",
"this",
".",
"parentContainer_",
";",
"this",
".",
"slices",
".",
"push",
"(",
"slice",
")",
";",
"return",
"slice",
";... | Helper function that pushes the provided slice onto the slices array.
@param {Slice} slice The slice to be added to the slices array. | [
"Helper",
"function",
"that",
"pushes",
"the",
"provided",
"slice",
"onto",
"the",
"slices",
"array",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice_group.js#L96-L101 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice_group.js | function(slices) {
this.haveTopLevelSlicesBeenBuilt = false;
slices.forEach(function(slice) {
slice.parentContainer = this.parentContainer_;
this.slices.push(slice);
}, this);
} | javascript | function(slices) {
this.haveTopLevelSlicesBeenBuilt = false;
slices.forEach(function(slice) {
slice.parentContainer = this.parentContainer_;
this.slices.push(slice);
}, this);
} | [
"function",
"(",
"slices",
")",
"{",
"this",
".",
"haveTopLevelSlicesBeenBuilt",
"=",
"false",
";",
"slices",
".",
"forEach",
"(",
"function",
"(",
"slice",
")",
"{",
"slice",
".",
"parentContainer",
"=",
"this",
".",
"parentContainer_",
";",
"this",
".",
... | Helper function that pushes the provided slices onto the slices array.
@param {Array.<Slice>} slices An array of slices to be added. | [
"Helper",
"function",
"that",
"pushes",
"the",
"provided",
"slices",
"onto",
"the",
"slices",
"array",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice_group.js#L107-L113 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice_group.js | function(category, title, ts, opt_args, opt_tts,
opt_argsStripped, opt_colorId) {
if (this.openPartialSlices_.length) {
var prevSlice = this.openPartialSlices_[
this.openPartialSlices_.length - 1];
if (ts < prevSlice.start)
throw new Error('Slices mus... | javascript | function(category, title, ts, opt_args, opt_tts,
opt_argsStripped, opt_colorId) {
if (this.openPartialSlices_.length) {
var prevSlice = this.openPartialSlices_[
this.openPartialSlices_.length - 1];
if (ts < prevSlice.start)
throw new Error('Slices mus... | [
"function",
"(",
"category",
",",
"title",
",",
"ts",
",",
"opt_args",
",",
"opt_tts",
",",
"opt_argsStripped",
",",
"opt_colorId",
")",
"{",
"if",
"(",
"this",
".",
"openPartialSlices_",
".",
"length",
")",
"{",
"var",
"prevSlice",
"=",
"this",
".",
"op... | Opens a new slice in the group's slices.
Calls to beginSlice and
endSlice must be made with non-monotonically-decreasing timestamps.
@param {String} category Category name of the slice to add.
@param {String} title Title of the slice to add.
@param {Number} ts The timetsamp of the slice, in milliseconds.
@param {Obje... | [
"Opens",
"a",
"new",
"slice",
"in",
"the",
"group",
"s",
"slices",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice_group.js#L129-L149 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice_group.js | function(ts, opt_tts, opt_colorId) {
if (!this.openSliceCount)
throw new Error('endSlice called without an open slice');
var slice = this.openPartialSlices_[this.openSliceCount - 1];
this.openPartialSlices_.splice(this.openSliceCount - 1, 1);
if (ts < slice.start)
throw new Erro... | javascript | function(ts, opt_tts, opt_colorId) {
if (!this.openSliceCount)
throw new Error('endSlice called without an open slice');
var slice = this.openPartialSlices_[this.openSliceCount - 1];
this.openPartialSlices_.splice(this.openSliceCount - 1, 1);
if (ts < slice.start)
throw new Erro... | [
"function",
"(",
"ts",
",",
"opt_tts",
",",
"opt_colorId",
")",
"{",
"if",
"(",
"!",
"this",
".",
"openSliceCount",
")",
"throw",
"new",
"Error",
"(",
"'endSlice called without an open slice'",
")",
";",
"var",
"slice",
"=",
"this",
".",
"openPartialSlices_",
... | Ends the last begun slice in this group and pushes it onto the slice
array.
@param {Number} ts Timestamp when the slice ended
@param {Number=} opt_colorId The color of the slice, defined by
its palette id (see ui/base/color_scheme.html).
@return {Slice} slice. | [
"Ends",
"the",
"last",
"begun",
"slice",
"in",
"this",
"group",
"and",
"pushes",
"it",
"onto",
"the",
"slice",
"array",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice_group.js#L181-L199 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice_group.js | function(category, title, ts, duration, tts,
cpuDuration, opt_args, opt_argsStripped,
opt_colorId, opt_bind_id) {
var colorId = opt_colorId ||
ColorScheme.getColorIdForGeneralPurposeString(title);
var slice = new this.sliceConstructor... | javascript | function(category, title, ts, duration, tts,
cpuDuration, opt_args, opt_argsStripped,
opt_colorId, opt_bind_id) {
var colorId = opt_colorId ||
ColorScheme.getColorIdForGeneralPurposeString(title);
var slice = new this.sliceConstructor... | [
"function",
"(",
"category",
",",
"title",
",",
"ts",
",",
"duration",
",",
"tts",
",",
"cpuDuration",
",",
"opt_args",
",",
"opt_argsStripped",
",",
"opt_colorId",
",",
"opt_bind_id",
")",
"{",
"var",
"colorId",
"=",
"opt_colorId",
"||",
"ColorScheme",
".",... | Push a complete event as a Slice into the slice list.
The timestamp can be in any order.
@param {String} category Category name of the slice to add.
@param {String} title Title of the slice to add.
@param {Number} ts The timetsamp of the slice, in milliseconds.
@param {Number} duration The duration of the slice, in mi... | [
"Push",
"a",
"complete",
"event",
"as",
"a",
"Slice",
"into",
"the",
"slice",
"list",
".",
"The",
"timestamp",
"can",
"be",
"in",
"any",
"order",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice_group.js#L214-L227 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice_group.js | function() {
this.updateBounds();
var maxTimestamp = this.bounds.max;
for (var sI = 0; sI < this.slices.length; sI++) {
var slice = this.slices[sI];
if (slice.didNotFinish)
slice.duration = maxTimestamp - slice.start;
}
this.openPartialSlices_ = [];
} | javascript | function() {
this.updateBounds();
var maxTimestamp = this.bounds.max;
for (var sI = 0; sI < this.slices.length; sI++) {
var slice = this.slices[sI];
if (slice.didNotFinish)
slice.duration = maxTimestamp - slice.start;
}
this.openPartialSlices_ = [];
} | [
"function",
"(",
")",
"{",
"this",
".",
"updateBounds",
"(",
")",
";",
"var",
"maxTimestamp",
"=",
"this",
".",
"bounds",
".",
"max",
";",
"for",
"(",
"var",
"sI",
"=",
"0",
";",
"sI",
"<",
"this",
".",
"slices",
".",
"length",
";",
"sI",
"++",
... | Closes any open slices.
@param {Number=} opt_maxTimestamp The end time to use for the closed
slices. If not provided,
the max timestamp for this slice is provided. | [
"Closes",
"any",
"open",
"slices",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice_group.js#L235-L244 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice_group.js | function(amount) {
for (var sI = 0; sI < this.slices.length; sI++) {
var slice = this.slices[sI];
slice.start = (slice.start + amount);
}
} | javascript | function(amount) {
for (var sI = 0; sI < this.slices.length; sI++) {
var slice = this.slices[sI];
slice.start = (slice.start + amount);
}
} | [
"function",
"(",
"amount",
")",
"{",
"for",
"(",
"var",
"sI",
"=",
"0",
";",
"sI",
"<",
"this",
".",
"slices",
".",
"length",
";",
"sI",
"++",
")",
"{",
"var",
"slice",
"=",
"this",
".",
"slices",
"[",
"sI",
"]",
";",
"slice",
".",
"start",
"... | Shifts all the timestamps inside this group forward by the amount
specified. | [
"Shifts",
"all",
"the",
"timestamps",
"inside",
"this",
"group",
"forward",
"by",
"the",
"amount",
"specified",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice_group.js#L250-L255 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/slice_group.js | function() {
this.bounds.reset();
for (var i = 0; i < this.slices.length; i++) {
this.bounds.addValue(this.slices[i].start);
this.bounds.addValue(this.slices[i].end);
}
} | javascript | function() {
this.bounds.reset();
for (var i = 0; i < this.slices.length; i++) {
this.bounds.addValue(this.slices[i].start);
this.bounds.addValue(this.slices[i].end);
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"bounds",
".",
"reset",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"slices",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"bounds",
".",
"addValue",
"(",
"this... | Updates the bounds for this group based on the slices it contains. | [
"Updates",
"the",
"bounds",
"for",
"this",
"group",
"based",
"on",
"the",
"slices",
"it",
"contains",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/slice_group.js#L260-L266 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/location.js | function(viewport) {
var containerToTrack = viewport.containerToTrackMap;
for (var i in this.yComponents_) {
var yComponent = this.yComponents_[i];
var track = containerToTrack.getTrackByStableId(yComponent.stableId);
if (track !== undefined)
return track;
}
} | javascript | function(viewport) {
var containerToTrack = viewport.containerToTrackMap;
for (var i in this.yComponents_) {
var yComponent = this.yComponents_[i];
var track = containerToTrack.getTrackByStableId(yComponent.stableId);
if (track !== undefined)
return track;
}
} | [
"function",
"(",
"viewport",
")",
"{",
"var",
"containerToTrack",
"=",
"viewport",
".",
"containerToTrackMap",
";",
"for",
"(",
"var",
"i",
"in",
"this",
".",
"yComponents_",
")",
"{",
"var",
"yComponent",
"=",
"this",
".",
"yComponents_",
"[",
"i",
"]",
... | Returns the first valid containing track based on the
internal yComponents. | [
"Returns",
"the",
"first",
"valid",
"containing",
"track",
"based",
"on",
"the",
"internal",
"yComponents",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/location.js#L112-L120 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/location.js | function(viewport) {
var dt = viewport.currentDisplayTransform;
var containerToTrack = viewport.containerToTrackMap;
var viewX = dt.xWorldToView(this.xWorld_);
var viewY = -1;
for (var index in this.yComponents_) {
var yComponent = this.yComponents_[index];
var track = con... | javascript | function(viewport) {
var dt = viewport.currentDisplayTransform;
var containerToTrack = viewport.containerToTrackMap;
var viewX = dt.xWorldToView(this.xWorld_);
var viewY = -1;
for (var index in this.yComponents_) {
var yComponent = this.yComponents_[index];
var track = con... | [
"function",
"(",
"viewport",
")",
"{",
"var",
"dt",
"=",
"viewport",
".",
"currentDisplayTransform",
";",
"var",
"containerToTrack",
"=",
"viewport",
".",
"containerToTrackMap",
";",
"var",
"viewX",
"=",
"dt",
".",
"xWorldToView",
"(",
"this",
".",
"xWorld_",
... | Calculates and returns x and y coordinates of the current location with
respect to the timeline's canvas. | [
"Calculates",
"and",
"returns",
"x",
"and",
"y",
"coordinates",
"of",
"the",
"current",
"location",
"with",
"respect",
"to",
"the",
"timeline",
"s",
"canvas",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/location.js#L126-L146 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/container_memory_dump.js | ContainerMemoryDump | function ContainerMemoryDump(start) {
tr.model.TimedEvent.call(this, start);
// 'light' or 'detailed' memory dump. See
// base::trace_event::MemoryDumpLevelOfDetail in the Chromium
// repository.
this.levelOfDetail = undefined;
this.memoryAllocatorDumps_ = undefined;
this.memoryAllocatorDu... | javascript | function ContainerMemoryDump(start) {
tr.model.TimedEvent.call(this, start);
// 'light' or 'detailed' memory dump. See
// base::trace_event::MemoryDumpLevelOfDetail in the Chromium
// repository.
this.levelOfDetail = undefined;
this.memoryAllocatorDumps_ = undefined;
this.memoryAllocatorDu... | [
"function",
"ContainerMemoryDump",
"(",
"start",
")",
"{",
"tr",
".",
"model",
".",
"TimedEvent",
".",
"call",
"(",
"this",
",",
"start",
")",
";",
"// 'light' or 'detailed' memory dump. See",
"// base::trace_event::MemoryDumpLevelOfDetail in the Chromium",
"// repository."... | The ContainerMemoryDump represents an abstract container memory dump.
@constructor | [
"The",
"ContainerMemoryDump",
"represents",
"an",
"abstract",
"container",
"memory",
"dump",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/container_memory_dump.js#L19-L29 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/process.js | Process | function Process(model, pid) {
if (model === undefined)
throw new Error('model must be provided');
if (pid === undefined)
throw new Error('pid must be provided');
tr.model.ProcessBase.call(this, model);
this.pid = pid;
this.name = undefined;
this.labels = [];
this.instantEvents =... | javascript | function Process(model, pid) {
if (model === undefined)
throw new Error('model must be provided');
if (pid === undefined)
throw new Error('pid must be provided');
tr.model.ProcessBase.call(this, model);
this.pid = pid;
this.name = undefined;
this.labels = [];
this.instantEvents =... | [
"function",
"Process",
"(",
"model",
",",
"pid",
")",
"{",
"if",
"(",
"model",
"===",
"undefined",
")",
"throw",
"new",
"Error",
"(",
"'model must be provided'",
")",
";",
"if",
"(",
"pid",
"===",
"undefined",
")",
"throw",
"new",
"Error",
"(",
"'pid mus... | The Process represents a single userland process in the
trace.
@constructor | [
"The",
"Process",
"represents",
"a",
"single",
"userland",
"process",
"in",
"the",
"trace",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/process.js#L26-L39 | train |
googlearchive/node-big-rig | lib/third_party/tracing/ui/base/ui.js | decorate | function decorate(source, constr) {
var elements;
if (typeof source == 'string')
elements = tr.doc.querySelectorAll(source);
else
elements = [source];
for (var i = 0, el; el = elements[i]; i++) {
if (!(el instanceof constr))
constr.decorate(el);
}
} | javascript | function decorate(source, constr) {
var elements;
if (typeof source == 'string')
elements = tr.doc.querySelectorAll(source);
else
elements = [source];
for (var i = 0, el; el = elements[i]; i++) {
if (!(el instanceof constr))
constr.decorate(el);
}
} | [
"function",
"decorate",
"(",
"source",
",",
"constr",
")",
"{",
"var",
"elements",
";",
"if",
"(",
"typeof",
"source",
"==",
"'string'",
")",
"elements",
"=",
"tr",
".",
"doc",
".",
"querySelectorAll",
"(",
"source",
")",
";",
"else",
"elements",
"=",
... | Decorates elements as an instance of a class.
@param {string|!Element} source The way to find the element(s) to decorate.
If this is a string then {@code querySeletorAll} is used to find the
elements to decorate.
@param {!Function} constr The constructor to decorate with. The constr
needs to have a {@code decorate} fun... | [
"Decorates",
"elements",
"as",
"an",
"instance",
"of",
"a",
"class",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/ui/base/ui.js#L21-L32 | train |
googlearchive/node-big-rig | lib/third_party/tracing/ui/base/ui.js | define | function define(className, opt_parentConstructor, opt_tagNS) {
if (typeof className == 'function') {
throw new Error('Passing functions as className is deprecated. Please ' +
'use (className, opt_parentConstructor) to subclass');
}
var className = className.toLowerCase();
if... | javascript | function define(className, opt_parentConstructor, opt_tagNS) {
if (typeof className == 'function') {
throw new Error('Passing functions as className is deprecated. Please ' +
'use (className, opt_parentConstructor) to subclass');
}
var className = className.toLowerCase();
if... | [
"function",
"define",
"(",
"className",
",",
"opt_parentConstructor",
",",
"opt_tagNS",
")",
"{",
"if",
"(",
"typeof",
"className",
"==",
"'function'",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Passing functions as className is deprecated. Please '",
"+",
"'use (class... | Defines a tracing UI component, a function that can be called to construct
the component.
tr class:
var List = tr.ui.b.define('list');
List.prototype = {
__proto__: HTMLUListElement.prototype,
decorate: function() {
...
},
...
};
Derived class:
var CustomList = tr.ui.b.define('custom-list', List);
CustomList.prototyp... | [
"Defines",
"a",
"tracing",
"UI",
"component",
"a",
"function",
"that",
"can",
"be",
"called",
"to",
"construct",
"the",
"component",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/ui/base/ui.js#L74-L148 | train |
googlearchive/node-big-rig | lib/third_party/tracing/ui/base/ui.js | f | function f() {
if (opt_parentConstructor &&
f.prototype.__proto__ != opt_parentConstructor.prototype) {
throw new Error(
className + ' prototye\'s __proto__ field is messed up. ' +
'It MUST be the prototype of ' + opt_parentConstructor.tagName);
}
var el;
... | javascript | function f() {
if (opt_parentConstructor &&
f.prototype.__proto__ != opt_parentConstructor.prototype) {
throw new Error(
className + ' prototye\'s __proto__ field is messed up. ' +
'It MUST be the prototype of ' + opt_parentConstructor.tagName);
}
var el;
... | [
"function",
"f",
"(",
")",
"{",
"if",
"(",
"opt_parentConstructor",
"&&",
"f",
".",
"prototype",
".",
"__proto__",
"!=",
"opt_parentConstructor",
".",
"prototype",
")",
"{",
"throw",
"new",
"Error",
"(",
"className",
"+",
"' prototye\\'s __proto__ field is messed ... | Creates a new UI element constructor.
Arguments passed to the constuctor are provided to the decorate method.
You will need to call the parent elements decorate method from within
your decorate method and pass any required parameters.
@constructor | [
"Creates",
"a",
"new",
"UI",
"element",
"constructor",
".",
"Arguments",
"passed",
"to",
"the",
"constuctor",
"are",
"provided",
"to",
"the",
"decorate",
"method",
".",
"You",
"will",
"need",
"to",
"call",
"the",
"parent",
"elements",
"decorate",
"method",
"... | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/ui/base/ui.js#L109-L124 | train |
googlearchive/node-big-rig | lib/third_party/tracing/ui/annotations/comment_box_annotation_view.js | CommentBoxAnnotationView | function CommentBoxAnnotationView(viewport, annotation) {
this.viewport_ = viewport;
this.annotation_ = annotation;
this.textArea_ = undefined;
this.styleWidth = 250;
this.styleHeight = 50;
this.fontSize = 10;
this.rightOffset = 50;
this.topOffset = 25;
} | javascript | function CommentBoxAnnotationView(viewport, annotation) {
this.viewport_ = viewport;
this.annotation_ = annotation;
this.textArea_ = undefined;
this.styleWidth = 250;
this.styleHeight = 50;
this.fontSize = 10;
this.rightOffset = 50;
this.topOffset = 25;
} | [
"function",
"CommentBoxAnnotationView",
"(",
"viewport",
",",
"annotation",
")",
"{",
"this",
".",
"viewport_",
"=",
"viewport",
";",
"this",
".",
"annotation_",
"=",
"annotation",
";",
"this",
".",
"textArea_",
"=",
"undefined",
";",
"this",
".",
"styleWidth"... | A view of a comment box consisting of a textarea and a line to the
actual location.
@extends {AnnotationView}
@constructor | [
"A",
"view",
"of",
"a",
"comment",
"box",
"consisting",
"of",
"a",
"textarea",
"and",
"a",
"line",
"to",
"the",
"actual",
"location",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/ui/annotations/comment_box_annotation_view.js#L18-L28 | train |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function(address, amount, label, message) {
var tmpl = ["bitcoin:", address, "?"];
if(amount) {
tmpl = tmpl.concat(["amount=", encodeURIComponent(amount), "&"]);
}
if(label) {
tmpl = tmpl.concat(["label=", encodeURIComponent(label), "&"]);
}
if(... | javascript | function(address, amount, label, message) {
var tmpl = ["bitcoin:", address, "?"];
if(amount) {
tmpl = tmpl.concat(["amount=", encodeURIComponent(amount), "&"]);
}
if(label) {
tmpl = tmpl.concat(["label=", encodeURIComponent(label), "&"]);
}
if(... | [
"function",
"(",
"address",
",",
"amount",
",",
"label",
",",
"message",
")",
"{",
"var",
"tmpl",
"=",
"[",
"\"bitcoin:\"",
",",
"address",
",",
"\"?\"",
"]",
";",
"if",
"(",
"amount",
")",
"{",
"tmpl",
"=",
"tmpl",
".",
"concat",
"(",
"[",
"\"amou... | Create URL for bitcoin URI scheme payments.
https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki#Examples
http://bitcoin.stackexchange.com/questions/4987/bitcoin-url-scheme
@param {String} address Receiving address
@param {String} amount Amount as big decimal
@param {String} label [description]
@para... | [
"Create",
"URL",
"for",
"bitcoin",
"URI",
"scheme",
"payments",
"."
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L40-L61 | train | |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function(elem, source) {
// Replace .bitcoin-address in the template
var addr = elem.find(".bitcoin-address");
// Add a maker class so that we don't reapply template
// on the subsequent scans
addr.addClass("bitcoin-address-controls");
addr.text(source.attr("data-bc-ad... | javascript | function(elem, source) {
// Replace .bitcoin-address in the template
var addr = elem.find(".bitcoin-address");
// Add a maker class so that we don't reapply template
// on the subsequent scans
addr.addClass("bitcoin-address-controls");
addr.text(source.attr("data-bc-ad... | [
"function",
"(",
"elem",
",",
"source",
")",
"{",
"// Replace .bitcoin-address in the template",
"var",
"addr",
"=",
"elem",
".",
"find",
"(",
"\".bitcoin-address\"",
")",
";",
"// Add a maker class so that we don't reapply template",
"// on the subsequent scans",
"addr",
"... | Build special HTML for bitcoin address manipulation.
@param {DOM} elem Templatized target
@param {DOM} source Original source tree element with data attributes | [
"Build",
"special",
"HTML",
"for",
"bitcoin",
"address",
"manipulation",
"."
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L68-L92 | train | |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function() {
var template = document.getElementById(this.config.template);
if(!template) {
throw new Error("Bitcoin address template element missing:" + this.config.template);
}
template = $(template);
if(template.size() != 1) {
throw new Error("Bitcoi... | javascript | function() {
var template = document.getElementById(this.config.template);
if(!template) {
throw new Error("Bitcoin address template element missing:" + this.config.template);
}
template = $(template);
if(template.size() != 1) {
throw new Error("Bitcoi... | [
"function",
"(",
")",
"{",
"var",
"template",
"=",
"document",
".",
"getElementById",
"(",
"this",
".",
"config",
".",
"template",
")",
";",
"if",
"(",
"!",
"template",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Bitcoin address template element missing:\"",
... | Get the template element defined in the options.
@return {[type]} [description] | [
"Get",
"the",
"template",
"element",
"defined",
"in",
"the",
"options",
"."
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L98-L113 | train | |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function(target, template) {
if(!template) {
template = this.getTemplate();
}
// Make a deep copy, so we don't accidentally modify
// template elements in-place
var elem = template.clone(false, true);
this.buildControls(elem, target);
// Make sure ... | javascript | function(target, template) {
if(!template) {
template = this.getTemplate();
}
// Make a deep copy, so we don't accidentally modify
// template elements in-place
var elem = template.clone(false, true);
this.buildControls(elem, target);
// Make sure ... | [
"function",
"(",
"target",
",",
"template",
")",
"{",
"if",
"(",
"!",
"template",
")",
"{",
"template",
"=",
"this",
".",
"getTemplate",
"(",
")",
";",
"}",
"// Make a deep copy, so we don't accidentally modify",
"// template elements in-place",
"var",
"elem",
"="... | Applies bitcoinaddress DOM template to a certain element.
The `target` element must contain necessary data-attributes
from where we scoop the info.
Also builds bitcoin: URI.
@param {jQuery} elem jQuery selection of target bitcoin address
@param {jQuery} template (optional) Template element to be applied | [
"Applies",
"bitcoinaddress",
"DOM",
"template",
"to",
"a",
"certain",
"element",
"."
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L126-L145 | train | |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function() {
var self = this;
var template = this.getTemplate();
// Optionally bail out if the default selection
// is not given (user calls applyTemplate() manually)
if(!this.config.selector) {
return;
}
$(this.config.selector).each(function() {
... | javascript | function() {
var self = this;
var template = this.getTemplate();
// Optionally bail out if the default selection
// is not given (user calls applyTemplate() manually)
if(!this.config.selector) {
return;
}
$(this.config.selector).each(function() {
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"template",
"=",
"this",
".",
"getTemplate",
"(",
")",
";",
"// Optionally bail out if the default selection",
"// is not given (user calls applyTemplate() manually)",
"if",
"(",
"!",
"this",
".",
"c... | Scan the page for bitcoin addresses.
Create user interface for all bitcoin address elements on the page-.
You can call this function multiple times if new bitcoin addresses become available. | [
"Scan",
"the",
"page",
"for",
"bitcoin",
"addresses",
"."
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L153-L182 | train | |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function(elem) {
var addy = elem.find(".bitcoin-address");
window.getSelection().selectAllChildren(addy.get(0));
elem.find(".bitcoin-action-hint").hide();
elem.find(".bitcoin-action-hint-copy").slideDown();
} | javascript | function(elem) {
var addy = elem.find(".bitcoin-address");
window.getSelection().selectAllChildren(addy.get(0));
elem.find(".bitcoin-action-hint").hide();
elem.find(".bitcoin-action-hint-copy").slideDown();
} | [
"function",
"(",
"elem",
")",
"{",
"var",
"addy",
"=",
"elem",
".",
"find",
"(",
"\".bitcoin-address\"",
")",
";",
"window",
".",
"getSelection",
"(",
")",
".",
"selectAllChildren",
"(",
"addy",
".",
"get",
"(",
"0",
")",
")",
";",
"elem",
".",
"find... | Prepare selection in .bitcoin-address-container for copy paste | [
"Prepare",
"selection",
"in",
".",
"bitcoin",
"-",
"address",
"-",
"container",
"for",
"copy",
"paste"
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L187-L192 | train | |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function(e) {
var elem = $(e.target).parents(".bitcoin-address-container");
// We never know if the click action was succesfully complete
elem.find(".bitcoin-action-hint").hide();
elem.find(".bitcoin-action-hint-send").slideDown();
} | javascript | function(e) {
var elem = $(e.target).parents(".bitcoin-address-container");
// We never know if the click action was succesfully complete
elem.find(".bitcoin-action-hint").hide();
elem.find(".bitcoin-action-hint-send").slideDown();
} | [
"function",
"(",
"e",
")",
"{",
"var",
"elem",
"=",
"$",
"(",
"e",
".",
"target",
")",
".",
"parents",
"(",
"\".bitcoin-address-container\"",
")",
";",
"// We never know if the click action was succesfully complete",
"elem",
".",
"find",
"(",
"\".bitcoin-action-hint... | Send payment action handler | [
"Send",
"payment",
"action",
"handler"
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L197-L202 | train | |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function(e) {
e.preventDefault();
var elem = $(e.target).parents(".bitcoin-address-container");
this.prepareCopySelection(elem);
return false;
} | javascript | function(e) {
e.preventDefault();
var elem = $(e.target).parents(".bitcoin-address-container");
this.prepareCopySelection(elem);
return false;
} | [
"function",
"(",
"e",
")",
"{",
"e",
".",
"preventDefault",
"(",
")",
";",
"var",
"elem",
"=",
"$",
"(",
"e",
".",
"target",
")",
".",
"parents",
"(",
"\".bitcoin-address-container\"",
")",
";",
"this",
".",
"prepareCopySelection",
"(",
"elem",
")",
";... | Copy action handler. | [
"Copy",
"action",
"handler",
"."
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L207-L212 | train | |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function(qrContainer) {
var elem = qrContainer.parents(".bitcoin-address-container");
var url;
//var addr = elem.attr("data-bc-address");
if(this.config.qrRawAddress) {
url = elem.attr("data-bc-address");
} else {
url = this.buildBitcoinURI(elem.attr("da... | javascript | function(qrContainer) {
var elem = qrContainer.parents(".bitcoin-address-container");
var url;
//var addr = elem.attr("data-bc-address");
if(this.config.qrRawAddress) {
url = elem.attr("data-bc-address");
} else {
url = this.buildBitcoinURI(elem.attr("da... | [
"function",
"(",
"qrContainer",
")",
"{",
"var",
"elem",
"=",
"qrContainer",
".",
"parents",
"(",
"\".bitcoin-address-container\"",
")",
";",
"var",
"url",
";",
"//var addr = elem.attr(\"data-bc-address\");",
"if",
"(",
"this",
".",
"config",
".",
"qrRawAddress",
... | Generates QR code inside the target element. | [
"Generates",
"QR",
"code",
"inside",
"the",
"target",
"element",
"."
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L218-L236 | train | |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function(e) {
e.preventDefault();
var elem = $(e.target).parents(".bitcoin-address-container");
var addr = elem.attr("data-bc-address");
var qrContainer = elem.find(".bitcoin-address-qr-container");
// Lazily generate the QR code
if(qrContainer.children().size() === 0) {... | javascript | function(e) {
e.preventDefault();
var elem = $(e.target).parents(".bitcoin-address-container");
var addr = elem.attr("data-bc-address");
var qrContainer = elem.find(".bitcoin-address-qr-container");
// Lazily generate the QR code
if(qrContainer.children().size() === 0) {... | [
"function",
"(",
"e",
")",
"{",
"e",
".",
"preventDefault",
"(",
")",
";",
"var",
"elem",
"=",
"$",
"(",
"e",
".",
"target",
")",
".",
"parents",
"(",
"\".bitcoin-address-container\"",
")",
";",
"var",
"addr",
"=",
"elem",
".",
"attr",
"(",
"\"data-b... | QR code generation action. | [
"QR",
"code",
"generation",
"action",
"."
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L241-L256 | train | |
miohtama/bitcoinaddress.js | bitcoinaddress.js | function(_config) {
var self = this;
if(!_config) {
throw new Error("You must give bitcoinaddress config object");
}
this.config = _config;
$ = this.config.jQuery || jQuery;
this.scan();
this.initUX();
} | javascript | function(_config) {
var self = this;
if(!_config) {
throw new Error("You must give bitcoinaddress config object");
}
this.config = _config;
$ = this.config.jQuery || jQuery;
this.scan();
this.initUX();
} | [
"function",
"(",
"_config",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"_config",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"You must give bitcoinaddress config object\"",
")",
";",
"}",
"this",
".",
"config",
"=",
"_config",
";",
"$",
"=... | Call to initialize the detault bitcoinprices UI. | [
"Call",
"to",
"initialize",
"the",
"detault",
"bitcoinprices",
"UI",
"."
] | a91bce47f0a04a6fc2dc256af0c1b30b14b46628 | https://github.com/miohtama/bitcoinaddress.js/blob/a91bce47f0a04a6fc2dc256af0c1b30b14b46628/bitcoinaddress.js#L291-L301 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/importer/import.js | function(traces) {
if (tr.isHeadless)
throw new Error('Cannot use this method in headless mode.');
var overlay = tr.ui.b.Overlay();
overlay.title = 'Importing...';
overlay.userCanClose = false;
overlay.msgEl = document.createElement('div');
overlay.appendChild(overlay.msgEl)... | javascript | function(traces) {
if (tr.isHeadless)
throw new Error('Cannot use this method in headless mode.');
var overlay = tr.ui.b.Overlay();
overlay.title = 'Importing...';
overlay.userCanClose = false;
overlay.msgEl = document.createElement('div');
overlay.appendChild(overlay.msgEl)... | [
"function",
"(",
"traces",
")",
"{",
"if",
"(",
"tr",
".",
"isHeadless",
")",
"throw",
"new",
"Error",
"(",
"'Cannot use this method in headless mode.'",
")",
";",
"var",
"overlay",
"=",
"tr",
".",
"ui",
".",
"b",
".",
"Overlay",
"(",
")",
";",
"overlay"... | Imports a trace with the usual options from importTraces, but
does so using idle callbacks, putting up an import dialog
during the import process. | [
"Imports",
"a",
"trace",
"with",
"the",
"usual",
"options",
"from",
"importTraces",
"but",
"does",
"so",
"using",
"idle",
"callbacks",
"putting",
"up",
"an",
"import",
"dialog",
"during",
"the",
"import",
"process",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/importer/import.js#L74-L96 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/event_container.js | EventContainer | function EventContainer() {
this.guid_ = tr.b.GUID.allocate();
this.important = true;
this.bounds_ = new tr.b.Range();
} | javascript | function EventContainer() {
this.guid_ = tr.b.GUID.allocate();
this.important = true;
this.bounds_ = new tr.b.Range();
} | [
"function",
"EventContainer",
"(",
")",
"{",
"this",
".",
"guid_",
"=",
"tr",
".",
"b",
".",
"GUID",
".",
"allocate",
"(",
")",
";",
"this",
".",
"important",
"=",
"true",
";",
"this",
".",
"bounds_",
"=",
"new",
"tr",
".",
"b",
".",
"Range",
"("... | EventContainer is a base class for any class in the trace model that
contains child events or child EventContainers.
For all EventContainers, updateBounds() must be called after modifying the
container's events if an up-to-date bounds is expected.
@constructor | [
"EventContainer",
"is",
"a",
"base",
"class",
"for",
"any",
"class",
"in",
"the",
"trace",
"model",
"that",
"contains",
"child",
"events",
"or",
"child",
"EventContainers",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/event_container.js#L24-L28 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/event_container.js | function(callback, opt_this) {
this.iterateAllEventContainers(function(ec) {
ec.iterateAllEventsInThisContainer(
function(eventType) { return true; },
callback, opt_this);
});
} | javascript | function(callback, opt_this) {
this.iterateAllEventContainers(function(ec) {
ec.iterateAllEventsInThisContainer(
function(eventType) { return true; },
callback, opt_this);
});
} | [
"function",
"(",
"callback",
",",
"opt_this",
")",
"{",
"this",
".",
"iterateAllEventContainers",
"(",
"function",
"(",
"ec",
")",
"{",
"ec",
".",
"iterateAllEventsInThisContainer",
"(",
"function",
"(",
"eventType",
")",
"{",
"return",
"true",
";",
"}",
","... | Iterates over all ancestor events. | [
"Iterates",
"over",
"all",
"ancestor",
"events",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/event_container.js#L90-L96 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/event_container.js | function(callback, opt_this) {
function visit(ec) {
callback.call(opt_this, ec);
ec.iterateAllChildEventContainers(visit);
}
visit(this);
} | javascript | function(callback, opt_this) {
function visit(ec) {
callback.call(opt_this, ec);
ec.iterateAllChildEventContainers(visit);
}
visit(this);
} | [
"function",
"(",
"callback",
",",
"opt_this",
")",
"{",
"function",
"visit",
"(",
"ec",
")",
"{",
"callback",
".",
"call",
"(",
"opt_this",
",",
"ec",
")",
";",
"ec",
".",
"iterateAllChildEventContainers",
"(",
"visit",
")",
";",
"}",
"visit",
"(",
"th... | Iterates over this container and all ancestor containers. | [
"Iterates",
"over",
"this",
"container",
"and",
"all",
"ancestor",
"containers",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/event_container.js#L101-L107 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/event.js | Event | function Event() {
SelectableItem.call(this, this /* modelItem */);
this.guid_ = tr.b.GUID.allocate();
this.selectionState = SelectionState.NONE;
this.associatedAlerts = new tr.model.EventSet();
this.info = undefined;
} | javascript | function Event() {
SelectableItem.call(this, this /* modelItem */);
this.guid_ = tr.b.GUID.allocate();
this.selectionState = SelectionState.NONE;
this.associatedAlerts = new tr.model.EventSet();
this.info = undefined;
} | [
"function",
"Event",
"(",
")",
"{",
"SelectableItem",
".",
"call",
"(",
"this",
",",
"this",
"/* modelItem */",
")",
";",
"this",
".",
"guid_",
"=",
"tr",
".",
"b",
".",
"GUID",
".",
"allocate",
"(",
")",
";",
"this",
".",
"selectionState",
"=",
"Sel... | An Event is the base type for any non-container, selectable piece
of data in the trace model.
@constructor
@extends {SelectableItem} | [
"An",
"Event",
"is",
"the",
"base",
"type",
"for",
"any",
"non",
"-",
"container",
"selectable",
"piece",
"of",
"data",
"in",
"the",
"trace",
"model",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/event.js#L28-L34 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/thread_time_slice.js | ThreadTimeSlice | function ThreadTimeSlice(thread, schedulingState, cat,
start, args, opt_duration) {
Slice.call(this, cat, schedulingState,
this.getColorForState_(schedulingState),
start, args, opt_duration);
this.thread = thread;
this.schedulingState = schedulingState;
... | javascript | function ThreadTimeSlice(thread, schedulingState, cat,
start, args, opt_duration) {
Slice.call(this, cat, schedulingState,
this.getColorForState_(schedulingState),
start, args, opt_duration);
this.thread = thread;
this.schedulingState = schedulingState;
... | [
"function",
"ThreadTimeSlice",
"(",
"thread",
",",
"schedulingState",
",",
"cat",
",",
"start",
",",
"args",
",",
"opt_duration",
")",
"{",
"Slice",
".",
"call",
"(",
"this",
",",
"cat",
",",
"schedulingState",
",",
"this",
".",
"getColorForState_",
"(",
"... | A ThreadTimeSlice is a slice of time on a specific thread where that thread
was running on a specific CPU, or in a specific sleep state.
As a thread switches moves through its life, it sometimes goes to sleep and
can't run. Other times, its runnable but isn't actually assigned to a CPU.
Finally, sometimes it gets put ... | [
"A",
"ThreadTimeSlice",
"is",
"a",
"slice",
"of",
"time",
"on",
"a",
"specific",
"thread",
"where",
"that",
"thread",
"was",
"running",
"on",
"a",
"specific",
"CPU",
"or",
"in",
"a",
"specific",
"sleep",
"state",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/thread_time_slice.js#L50-L58 | train |
googlearchive/node-big-rig | lib/third_party/tracing/base/range_utils.js | findEmptyRangesBetweenRanges | function findEmptyRangesBetweenRanges(inRanges, opt_totalRange) {
if (opt_totalRange && opt_totalRange.isEmpty)
opt_totalRange = undefined;
var emptyRanges = [];
if (!inRanges.length) {
if (opt_totalRange)
emptyRanges.push(opt_totalRange);
return emptyRanges;
}
inRanges =... | javascript | function findEmptyRangesBetweenRanges(inRanges, opt_totalRange) {
if (opt_totalRange && opt_totalRange.isEmpty)
opt_totalRange = undefined;
var emptyRanges = [];
if (!inRanges.length) {
if (opt_totalRange)
emptyRanges.push(opt_totalRange);
return emptyRanges;
}
inRanges =... | [
"function",
"findEmptyRangesBetweenRanges",
"(",
"inRanges",
",",
"opt_totalRange",
")",
"{",
"if",
"(",
"opt_totalRange",
"&&",
"opt_totalRange",
".",
"isEmpty",
")",
"opt_totalRange",
"=",
"undefined",
";",
"var",
"emptyRanges",
"=",
"[",
"]",
";",
"if",
"(",
... | Pass in |opt_totalRange| in order to find empty ranges before the first of |inRanges| and after the last of |inRanges|. | [
"Pass",
"in",
"|opt_totalRange|",
"in",
"order",
"to",
"find",
"empty",
"ranges",
"before",
"the",
"first",
"of",
"|inRanges|",
"and",
"after",
"the",
"last",
"of",
"|inRanges|",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/base/range_utils.js#L81-L130 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/async_slice.js | AsyncSlice | function AsyncSlice(category, title, colorId, start, args, duration,
opt_isTopLevel, opt_cpuStart, opt_cpuDuration,
opt_argsStripped) {
tr.model.TimedEvent.call(this, start);
this.category = category || '';
// We keep the original title from the trace file in ori... | javascript | function AsyncSlice(category, title, colorId, start, args, duration,
opt_isTopLevel, opt_cpuStart, opt_cpuDuration,
opt_argsStripped) {
tr.model.TimedEvent.call(this, start);
this.category = category || '';
// We keep the original title from the trace file in ori... | [
"function",
"AsyncSlice",
"(",
"category",
",",
"title",
",",
"colorId",
",",
"start",
",",
"args",
",",
"duration",
",",
"opt_isTopLevel",
",",
"opt_cpuStart",
",",
"opt_cpuDuration",
",",
"opt_argsStripped",
")",
"{",
"tr",
".",
"model",
".",
"TimedEvent",
... | A AsyncSlice represents an interval of time during which an
asynchronous operation is in progress. An AsyncSlice consumes no CPU time
itself and so is only associated with Threads at its start and end point.
@constructor | [
"A",
"AsyncSlice",
"represents",
"an",
"interval",
"of",
"time",
"during",
"which",
"an",
"asynchronous",
"operation",
"is",
"in",
"progress",
".",
"An",
"AsyncSlice",
"consumes",
"no",
"CPU",
"time",
"itself",
"and",
"so",
"is",
"only",
"associated",
"with",
... | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/async_slice.js#L24-L67 | train |
googlearchive/node-big-rig | lib/third_party/tracing/base/task.js | Task | function Task(runCb, thisArg) {
if (runCb !== undefined && thisArg === undefined)
throw new Error('Almost certainly, you meant to pass a thisArg.');
this.runCb_ = runCb;
this.thisArg_ = thisArg;
this.afterTask_ = undefined;
this.subTasks_ = [];
} | javascript | function Task(runCb, thisArg) {
if (runCb !== undefined && thisArg === undefined)
throw new Error('Almost certainly, you meant to pass a thisArg.');
this.runCb_ = runCb;
this.thisArg_ = thisArg;
this.afterTask_ = undefined;
this.subTasks_ = [];
} | [
"function",
"Task",
"(",
"runCb",
",",
"thisArg",
")",
"{",
"if",
"(",
"runCb",
"!==",
"undefined",
"&&",
"thisArg",
"===",
"undefined",
")",
"throw",
"new",
"Error",
"(",
"'Almost certainly, you meant to pass a thisArg.'",
")",
";",
"this",
".",
"runCb_",
"="... | A task is a combination of a run callback, a set of subtasks, and an after
task.
When executed, a task does the following things:
1. Runs its callback
2. Runs its subtasks
3. Runs its after callback.
The list of subtasks and after task can be mutated inside step #1 but as
soon as the task's callback returns, the subt... | [
"A",
"task",
"is",
"a",
"combination",
"of",
"a",
"run",
"callback",
"a",
"set",
"of",
"subtasks",
"and",
"an",
"after",
"task",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/base/task.js#L38-L45 | train |
googlearchive/node-big-rig | lib/third_party/tracing/base/task.js | function() {
if (this.runCb_ !== undefined)
this.runCb_.call(this.thisArg_, this);
var subTasks = this.subTasks_;
this.subTasks_ = undefined; // Prevent more subTasks from being posted.
if (!subTasks.length)
return this.afterTask_;
// If there are subtasks, then we want t... | javascript | function() {
if (this.runCb_ !== undefined)
this.runCb_.call(this.thisArg_, this);
var subTasks = this.subTasks_;
this.subTasks_ = undefined; // Prevent more subTasks from being posted.
if (!subTasks.length)
return this.afterTask_;
// If there are subtasks, then we want t... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"runCb_",
"!==",
"undefined",
")",
"this",
".",
"runCb_",
".",
"call",
"(",
"this",
".",
"thisArg_",
",",
"this",
")",
";",
"var",
"subTasks",
"=",
"this",
".",
"subTasks_",
";",
"this",
".",
"subT... | Runs the current task and returns the task that should be executed next. | [
"Runs",
"the",
"current",
"task",
"and",
"returns",
"the",
"task",
"that",
"should",
"be",
"executed",
"next",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/base/task.js#L62-L80 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/object_instance.js | ObjectInstance | function ObjectInstance(
parent, id, category, name, creationTs, opt_baseTypeName) {
tr.model.Event.call(this);
this.parent = parent;
this.id = id;
this.category = category;
this.baseTypeName = opt_baseTypeName ? opt_baseTypeName : name;
this.name = name;
this.creationTs = creationTs;
... | javascript | function ObjectInstance(
parent, id, category, name, creationTs, opt_baseTypeName) {
tr.model.Event.call(this);
this.parent = parent;
this.id = id;
this.category = category;
this.baseTypeName = opt_baseTypeName ? opt_baseTypeName : name;
this.name = name;
this.creationTs = creationTs;
... | [
"function",
"ObjectInstance",
"(",
"parent",
",",
"id",
",",
"category",
",",
"name",
",",
"creationTs",
",",
"opt_baseTypeName",
")",
"{",
"tr",
".",
"model",
".",
"Event",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"parent",
"=",
"parent",
";",... | An object with a specific id, whose state has been snapshotted several
times.
@constructor | [
"An",
"object",
"with",
"a",
"specific",
"id",
"whose",
"state",
"has",
"been",
"snapshotted",
"several",
"times",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/object_instance.js#L27-L43 | train |
googlearchive/node-big-rig | lib/third_party/tracing/extras/rail/proto_ir.js | ProtoIR | function ProtoIR(irType, name) {
this.irType = irType;
this.names = new Set(name ? [name] : undefined);
this.start = Infinity;
this.end = -Infinity;
this.associatedEvents = new tr.model.EventSet();
} | javascript | function ProtoIR(irType, name) {
this.irType = irType;
this.names = new Set(name ? [name] : undefined);
this.start = Infinity;
this.end = -Infinity;
this.associatedEvents = new tr.model.EventSet();
} | [
"function",
"ProtoIR",
"(",
"irType",
",",
"name",
")",
"{",
"this",
".",
"irType",
"=",
"irType",
";",
"this",
".",
"names",
"=",
"new",
"Set",
"(",
"name",
"?",
"[",
"name",
"]",
":",
"undefined",
")",
";",
"this",
".",
"start",
"=",
"Infinity",
... | This is an intermediate data format between InputLatencyAsyncSlices and Response and Animation IRs. | [
"This",
"is",
"an",
"intermediate",
"data",
"format",
"between",
"InputLatencyAsyncSlices",
"and",
"Response",
"and",
"Animation",
"IRs",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/rail/proto_ir.js#L23-L29 | train |
googlearchive/node-big-rig | lib/third_party/tracing/extras/rail/proto_ir.js | function(typeNames) {
for (var i = 0; i < this.associatedEvents.length; ++i) {
if (typeNames.indexOf(this.associatedEvents[i].typeName) >= 0)
return true;
}
return false;
} | javascript | function(typeNames) {
for (var i = 0; i < this.associatedEvents.length; ++i) {
if (typeNames.indexOf(this.associatedEvents[i].typeName) >= 0)
return true;
}
return false;
} | [
"function",
"(",
"typeNames",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"associatedEvents",
".",
"length",
";",
"++",
"i",
")",
"{",
"if",
"(",
"typeNames",
".",
"indexOf",
"(",
"this",
".",
"associatedEvents",
"[",
"i... | Return true if any associatedEvent's typeName is in typeNames. | [
"Return",
"true",
"if",
"any",
"associatedEvent",
"s",
"typeName",
"is",
"in",
"typeNames",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/rail/proto_ir.js#L45-L51 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/extras/rail/proto_ir.js | function() {
var debugString = this.irType + '(';
debugString += parseInt(this.start) + ' ';
debugString += parseInt(this.end);
this.associatedEvents.forEach(function(event) {
debugString += ' ' + event.typeName;
});
return debugString + ')';
} | javascript | function() {
var debugString = this.irType + '(';
debugString += parseInt(this.start) + ' ';
debugString += parseInt(this.end);
this.associatedEvents.forEach(function(event) {
debugString += ' ' + event.typeName;
});
return debugString + ')';
} | [
"function",
"(",
")",
"{",
"var",
"debugString",
"=",
"this",
".",
"irType",
"+",
"'('",
";",
"debugString",
"+=",
"parseInt",
"(",
"this",
".",
"start",
")",
"+",
"' '",
";",
"debugString",
"+=",
"parseInt",
"(",
"this",
".",
"end",
")",
";",
"this"... | Return a string describing this ProtoIR for debugging. | [
"Return",
"a",
"string",
"describing",
"this",
"ProtoIR",
"for",
"debugging",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/rail/proto_ir.js#L151-L159 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/object_collection.js | ObjectCollection | function ObjectCollection(parent) {
tr.model.EventContainer.call(this);
this.parent = parent;
this.instanceMapsById_ = {}; // id -> TimeToObjectInstanceMap
this.instancesByTypeName_ = {};
this.createObjectInstance_ = this.createObjectInstance_.bind(this);
} | javascript | function ObjectCollection(parent) {
tr.model.EventContainer.call(this);
this.parent = parent;
this.instanceMapsById_ = {}; // id -> TimeToObjectInstanceMap
this.instancesByTypeName_ = {};
this.createObjectInstance_ = this.createObjectInstance_.bind(this);
} | [
"function",
"ObjectCollection",
"(",
"parent",
")",
"{",
"tr",
".",
"model",
".",
"EventContainer",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"parent",
"=",
"parent",
";",
"this",
".",
"instanceMapsById_",
"=",
"{",
"}",
";",
"// id -> TimeToObjectI... | A collection of object instances and their snapshots, accessible by id and
time, or by object name.
@constructor | [
"A",
"collection",
"of",
"object",
"instances",
"and",
"their",
"snapshots",
"accessible",
"by",
"id",
"and",
"time",
"or",
"by",
"object",
"name",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/object_collection.js#L29-L35 | train |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/linux_perf/gesture_parser.js | GestureParser | function GestureParser(importer) {
Parser.call(this, importer);
importer.registerEventHandler('tracing_mark_write:log',
GestureParser.prototype.logEvent.bind(this));
importer.registerEventHandler('tracing_mark_write:SyncInterpret',
GestureParser.prototype.syncEvent.bind(this));
importer.... | javascript | function GestureParser(importer) {
Parser.call(this, importer);
importer.registerEventHandler('tracing_mark_write:log',
GestureParser.prototype.logEvent.bind(this));
importer.registerEventHandler('tracing_mark_write:SyncInterpret',
GestureParser.prototype.syncEvent.bind(this));
importer.... | [
"function",
"GestureParser",
"(",
"importer",
")",
"{",
"Parser",
".",
"call",
"(",
"this",
",",
"importer",
")",
";",
"importer",
".",
"registerEventHandler",
"(",
"'tracing_mark_write:log'",
",",
"GestureParser",
".",
"prototype",
".",
"logEvent",
".",
"bind",... | Parses trace events generated by gesture library for touchpad.
@constructor | [
"Parses",
"trace",
"events",
"generated",
"by",
"gesture",
"library",
"for",
"touchpad",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/linux_perf/gesture_parser.js#L22-L30 | train |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/linux_perf/gesture_parser.js | function(title, ts, opt_args) {
var thread = this.importer.getOrCreatePseudoThread('gesture').thread;
thread.sliceGroup.beginSlice(
'touchpad_gesture', title, ts, opt_args);
} | javascript | function(title, ts, opt_args) {
var thread = this.importer.getOrCreatePseudoThread('gesture').thread;
thread.sliceGroup.beginSlice(
'touchpad_gesture', title, ts, opt_args);
} | [
"function",
"(",
"title",
",",
"ts",
",",
"opt_args",
")",
"{",
"var",
"thread",
"=",
"this",
".",
"importer",
".",
"getOrCreatePseudoThread",
"(",
"'gesture'",
")",
".",
"thread",
";",
"thread",
".",
"sliceGroup",
".",
"beginSlice",
"(",
"'touchpad_gesture'... | Parse events generate by gesture library.
gestureOpenSlice and gestureCloseSlice are two common
functions to store the begin time and end time for all
events in gesture library | [
"Parse",
"events",
"generate",
"by",
"gesture",
"library",
".",
"gestureOpenSlice",
"and",
"gestureCloseSlice",
"are",
"two",
"common",
"functions",
"to",
"store",
"the",
"begin",
"time",
"and",
"end",
"time",
"for",
"all",
"events",
"in",
"gesture",
"library"
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/linux_perf/gesture_parser.js#L41-L45 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/counter.js | Counter | function Counter(parent, id, category, name) {
tr.model.EventContainer.call(this);
this.parent_ = parent;
this.id_ = id;
this.category_ = category || '';
this.name_ = name;
this.series_ = [];
this.totals = [];
} | javascript | function Counter(parent, id, category, name) {
tr.model.EventContainer.call(this);
this.parent_ = parent;
this.id_ = id;
this.category_ = category || '';
this.name_ = name;
this.series_ = [];
this.totals = [];
} | [
"function",
"Counter",
"(",
"parent",
",",
"id",
",",
"category",
",",
"name",
")",
"{",
"tr",
".",
"model",
".",
"EventContainer",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"parent_",
"=",
"parent",
";",
"this",
".",
"id_",
"=",
"id",
";",
... | A container holding all series of a given type of measurement.
As an example, if we're measuring the throughput of data sent over several
USB connections, the throughput of each cable might be added as a separate
series to a single counter.
@constructor
@extends {EventContainer} | [
"A",
"container",
"holding",
"all",
"series",
"of",
"a",
"given",
"type",
"of",
"measurement",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/counter.js#L26-L36 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/counter.js | function(amount) {
for (var i = 0; i < this.series_.length; ++i)
this.series_[i].shiftTimestampsForward(amount);
} | javascript | function(amount) {
for (var i = 0; i < this.series_.length; ++i)
this.series_[i].shiftTimestampsForward(amount);
} | [
"function",
"(",
"amount",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"series_",
".",
"length",
";",
"++",
"i",
")",
"this",
".",
"series_",
"[",
"i",
"]",
".",
"shiftTimestampsForward",
"(",
"amount",
")",
";",
"}"
] | Shifts all the timestamps inside this counter forward by the amount
specified. | [
"Shifts",
"all",
"the",
"timestamps",
"inside",
"this",
"counter",
"forward",
"by",
"the",
"amount",
"specified",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/counter.js#L139-L142 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/counter.js | function() {
this.totals = [];
this.maxTotal = 0;
this.bounds.reset();
if (this.series_.length === 0)
return;
var firstSeries = this.series_[0];
var lastSeries = this.series_[this.series_.length - 1];
this.bounds.addValue(firstSeries.getTimestamp(0));
this.boun... | javascript | function() {
this.totals = [];
this.maxTotal = 0;
this.bounds.reset();
if (this.series_.length === 0)
return;
var firstSeries = this.series_[0];
var lastSeries = this.series_[this.series_.length - 1];
this.bounds.addValue(firstSeries.getTimestamp(0));
this.boun... | [
"function",
"(",
")",
"{",
"this",
".",
"totals",
"=",
"[",
"]",
";",
"this",
".",
"maxTotal",
"=",
"0",
";",
"this",
".",
"bounds",
".",
"reset",
"(",
")",
";",
"if",
"(",
"this",
".",
"series_",
".",
"length",
"===",
"0",
")",
"return",
";",
... | Updates the bounds for this counter based on the samples it contains. | [
"Updates",
"the",
"bounds",
"for",
"this",
"counter",
"based",
"on",
"the",
"samples",
"it",
"contains",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/counter.js#L147-L175 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/time_to_object_instance_map.js | TimeToObjectInstanceMap | function TimeToObjectInstanceMap(createObjectInstanceFunction, parent, id) {
this.createObjectInstanceFunction_ = createObjectInstanceFunction;
this.parent = parent;
this.id = id;
this.instances = [];
} | javascript | function TimeToObjectInstanceMap(createObjectInstanceFunction, parent, id) {
this.createObjectInstanceFunction_ = createObjectInstanceFunction;
this.parent = parent;
this.id = id;
this.instances = [];
} | [
"function",
"TimeToObjectInstanceMap",
"(",
"createObjectInstanceFunction",
",",
"parent",
",",
"id",
")",
"{",
"this",
".",
"createObjectInstanceFunction_",
"=",
"createObjectInstanceFunction",
";",
"this",
".",
"parent",
"=",
"parent",
";",
"this",
".",
"id",
"=",... | Tracks all the instances associated with a given ID over its lifetime.
An id can be used multiple times throughout a trace, referring to different
objects at different times. This data structure does the bookkeeping to
figure out what ObjectInstance is referred to at a given timestamp.
@constructor | [
"Tracks",
"all",
"the",
"instances",
"associated",
"with",
"a",
"given",
"ID",
"over",
"its",
"lifetime",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/time_to_object_instance_map.js#L25-L30 | train |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/linux_perf/regulator_parser.js | RegulatorParser | function RegulatorParser(importer) {
Parser.call(this, importer);
importer.registerEventHandler('regulator_enable',
RegulatorParser.prototype.regulatorEnableEvent.bind(this));
importer.registerEventHandler('regulator_enable_delay',
RegulatorParser.prototype.regulatorEnableDelayEvent.bind(th... | javascript | function RegulatorParser(importer) {
Parser.call(this, importer);
importer.registerEventHandler('regulator_enable',
RegulatorParser.prototype.regulatorEnableEvent.bind(this));
importer.registerEventHandler('regulator_enable_delay',
RegulatorParser.prototype.regulatorEnableDelayEvent.bind(th... | [
"function",
"RegulatorParser",
"(",
"importer",
")",
"{",
"Parser",
".",
"call",
"(",
"this",
",",
"importer",
")",
";",
"importer",
".",
"registerEventHandler",
"(",
"'regulator_enable'",
",",
"RegulatorParser",
".",
"prototype",
".",
"regulatorEnableEvent",
".",... | Parses linux regulator trace events.
@constructor | [
"Parses",
"linux",
"regulator",
"trace",
"events",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/linux_perf/regulator_parser.js#L23-L42 | train |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/linux_perf/regulator_parser.js | function(ctrName, valueName) {
var ctr = this.model_.kernel
.getOrCreateCounter(null, 'vreg ' + ctrName + ' ' + valueName);
// Initialize the counter's series fields if needed.
if (ctr.series[0] === undefined) {
ctr.addSeries(new tr.model.CounterSeries(valueName,
ColorScheme.ge... | javascript | function(ctrName, valueName) {
var ctr = this.model_.kernel
.getOrCreateCounter(null, 'vreg ' + ctrName + ' ' + valueName);
// Initialize the counter's series fields if needed.
if (ctr.series[0] === undefined) {
ctr.addSeries(new tr.model.CounterSeries(valueName,
ColorScheme.ge... | [
"function",
"(",
"ctrName",
",",
"valueName",
")",
"{",
"var",
"ctr",
"=",
"this",
".",
"model_",
".",
"kernel",
".",
"getOrCreateCounter",
"(",
"null",
",",
"'vreg '",
"+",
"ctrName",
"+",
"' '",
"+",
"valueName",
")",
";",
"// Initialize the counter's seri... | Get or create a counter with one series. | [
"Get",
"or",
"create",
"a",
"counter",
"with",
"one",
"series",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/linux_perf/regulator_parser.js#L59-L69 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/timed_event.js | TimedEvent | function TimedEvent(start) {
tr.model.Event.call(this);
this.start = start;
this.duration = 0;
this.cpuStart = undefined;
this.cpuDuration = undefined;
} | javascript | function TimedEvent(start) {
tr.model.Event.call(this);
this.start = start;
this.duration = 0;
this.cpuStart = undefined;
this.cpuDuration = undefined;
} | [
"function",
"TimedEvent",
"(",
"start",
")",
"{",
"tr",
".",
"model",
".",
"Event",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"start",
"=",
"start",
";",
"this",
".",
"duration",
"=",
"0",
";",
"this",
".",
"cpuStart",
"=",
"undefined",
";",... | A TimedEvent is the base type for any piece of data in the trace model with
a specific start and duration.
@constructor | [
"A",
"TimedEvent",
"is",
"the",
"base",
"type",
"for",
"any",
"piece",
"of",
"data",
"in",
"the",
"trace",
"model",
"with",
"a",
"specific",
"start",
"and",
"duration",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/timed_event.js#L23-L29 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/timed_event.js | function(that, precisionUnit) {
if (precisionUnit === undefined) {
precisionUnit = tr.b.u.TimeDisplayModes.ms;
}
var startsBefore = precisionUnit.roundedLess(that.start, this.start);
var endsAfter = precisionUnit.roundedLess(this.end, that.end);
return !startsBefore && !endsAfter;
... | javascript | function(that, precisionUnit) {
if (precisionUnit === undefined) {
precisionUnit = tr.b.u.TimeDisplayModes.ms;
}
var startsBefore = precisionUnit.roundedLess(that.start, this.start);
var endsAfter = precisionUnit.roundedLess(this.end, that.end);
return !startsBefore && !endsAfter;
... | [
"function",
"(",
"that",
",",
"precisionUnit",
")",
"{",
"if",
"(",
"precisionUnit",
"===",
"undefined",
")",
"{",
"precisionUnit",
"=",
"tr",
".",
"b",
".",
"u",
".",
"TimeDisplayModes",
".",
"ms",
";",
"}",
"var",
"startsBefore",
"=",
"precisionUnit",
... | bounds returns whether that TimedEvent happens within this timed event | [
"bounds",
"returns",
"whether",
"that",
"TimedEvent",
"happens",
"within",
"this",
"timed",
"event"
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/timed_event.js#L44-L51 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/base/iteration_helpers.js | comparePossiblyUndefinedValues | function comparePossiblyUndefinedValues(x, y, cmp, opt_this) {
if (x !== undefined && y !== undefined)
return cmp.call(opt_this, x, y);
if (x !== undefined)
return -1;
if (y !== undefined)
return 1;
return 0;
} | javascript | function comparePossiblyUndefinedValues(x, y, cmp, opt_this) {
if (x !== undefined && y !== undefined)
return cmp.call(opt_this, x, y);
if (x !== undefined)
return -1;
if (y !== undefined)
return 1;
return 0;
} | [
"function",
"comparePossiblyUndefinedValues",
"(",
"x",
",",
"y",
",",
"cmp",
",",
"opt_this",
")",
"{",
"if",
"(",
"x",
"!==",
"undefined",
"&&",
"y",
"!==",
"undefined",
")",
"return",
"cmp",
".",
"call",
"(",
"opt_this",
",",
"x",
",",
"y",
")",
"... | Compares two values when one or both might be undefined. Undefined
values are sorted after defined. | [
"Compares",
"two",
"values",
"when",
"one",
"or",
"both",
"might",
"be",
"undefined",
".",
"Undefined",
"values",
"are",
"sorted",
"after",
"defined",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/base/iteration_helpers.js#L39-L47 | train |
googlearchive/node-big-rig | lib/third_party/tracing/base/iteration_helpers.js | group | function group(ary, fn) {
return ary.reduce(function(accumulator, curr) {
var key = fn(curr);
if (key in accumulator)
accumulator[key].push(curr);
else
accumulator[key] = [curr];
return accumulator;
}, {});
} | javascript | function group(ary, fn) {
return ary.reduce(function(accumulator, curr) {
var key = fn(curr);
if (key in accumulator)
accumulator[key].push(curr);
else
accumulator[key] = [curr];
return accumulator;
}, {});
} | [
"function",
"group",
"(",
"ary",
",",
"fn",
")",
"{",
"return",
"ary",
".",
"reduce",
"(",
"function",
"(",
"accumulator",
",",
"curr",
")",
"{",
"var",
"key",
"=",
"fn",
"(",
"curr",
")",
";",
"if",
"(",
"key",
"in",
"accumulator",
")",
"accumulat... | Returns a new dictionary with items grouped by the return value of the
specified function being called on each item.
@param {!Array.<Object>} ary The array being iterated through
@param {!Function} fn The mapping function between the array value and the
map key. | [
"Returns",
"a",
"new",
"dictionary",
"with",
"items",
"grouped",
"by",
"the",
"return",
"value",
"of",
"the",
"specified",
"function",
"being",
"called",
"on",
"each",
"item",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/base/iteration_helpers.js#L119-L130 | train |
googlearchive/node-big-rig | lib/third_party/tracing/base/iteration_helpers.js | invertArrayOfDicts | function invertArrayOfDicts(array, opt_dictGetter, opt_this) {
opt_this = opt_this || this;
var result = {};
for (var i = 0; i < array.length; i++) {
var item = array[i];
if (item === undefined)
continue;
var dict = opt_dictGetter ? opt_dictGetter.call(opt_this, item) : item;
... | javascript | function invertArrayOfDicts(array, opt_dictGetter, opt_this) {
opt_this = opt_this || this;
var result = {};
for (var i = 0; i < array.length; i++) {
var item = array[i];
if (item === undefined)
continue;
var dict = opt_dictGetter ? opt_dictGetter.call(opt_this, item) : item;
... | [
"function",
"invertArrayOfDicts",
"(",
"array",
",",
"opt_dictGetter",
",",
"opt_this",
")",
"{",
"opt_this",
"=",
"opt_this",
"||",
"this",
";",
"var",
"result",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"len... | Convert an array of dictionaries to a dictionary of arrays.
The keys of the resulting dictionary are a union of the keys of all
dictionaries in the provided array. Each array in the resulting dictionary
has the same length as the provided array and contains the values of its
key in the dictionaries in the provided arr... | [
"Convert",
"an",
"array",
"of",
"dictionaries",
"to",
"a",
"dictionary",
"of",
"arrays",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/base/iteration_helpers.js#L227-L245 | train |
googlearchive/node-big-rig | lib/third_party/tracing/base/iteration_helpers.js | arrayToDict | function arrayToDict(array, valueToKeyFn, opt_this) {
opt_this = opt_this || this;
var result = {};
var length = array.length;
for (var i = 0; i < length; i++) {
var value = array[i];
var key = valueToKeyFn.call(opt_this, value);
result[key] = value;
}
return result;
} | javascript | function arrayToDict(array, valueToKeyFn, opt_this) {
opt_this = opt_this || this;
var result = {};
var length = array.length;
for (var i = 0; i < length; i++) {
var value = array[i];
var key = valueToKeyFn.call(opt_this, value);
result[key] = value;
}
return result;
} | [
"function",
"arrayToDict",
"(",
"array",
",",
"valueToKeyFn",
",",
"opt_this",
")",
"{",
"opt_this",
"=",
"opt_this",
"||",
"this",
";",
"var",
"result",
"=",
"{",
"}",
";",
"var",
"length",
"=",
"array",
".",
"length",
";",
"for",
"(",
"var",
"i",
"... | Convert an array to a dictionary.
Every element in the array is mapped in the dictionary to the key returned
by the provided function:
dictionary[valueToKeyFn(element)] = element;
@param {!Array} array Arbitrary array.
@param {function(*): string} valueToKeyFn Function mapping array elements
to dictionary keys.
@par... | [
"Convert",
"an",
"array",
"to",
"a",
"dictionary",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/base/iteration_helpers.js#L260-L270 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/process_memory_dump.js | ProcessMemoryDump | function ProcessMemoryDump(globalMemoryDump, process, start) {
tr.model.ContainerMemoryDump.call(this, start);
this.process = process;
this.globalMemoryDump = globalMemoryDump;
// Process memory totals (optional object) with the following fields (also
// optional):
// - residentBytes: Total r... | javascript | function ProcessMemoryDump(globalMemoryDump, process, start) {
tr.model.ContainerMemoryDump.call(this, start);
this.process = process;
this.globalMemoryDump = globalMemoryDump;
// Process memory totals (optional object) with the following fields (also
// optional):
// - residentBytes: Total r... | [
"function",
"ProcessMemoryDump",
"(",
"globalMemoryDump",
",",
"process",
",",
"start",
")",
"{",
"tr",
".",
"model",
".",
"ContainerMemoryDump",
".",
"call",
"(",
"this",
",",
"start",
")",
";",
"this",
".",
"process",
"=",
"process",
";",
"this",
".",
... | The ProcessMemoryDump represents a memory dump of a single process.
@constructor | [
"The",
"ProcessMemoryDump",
"represents",
"a",
"memory",
"dump",
"of",
"a",
"single",
"process",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/process_memory_dump.js#L43-L65 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/thread_slice.js | ThreadSlice | function ThreadSlice(cat, title, colorId, start, args, opt_duration,
opt_cpuStart, opt_cpuDuration, opt_argsStripped,
opt_bind_id) {
Slice.call(this, cat, title, colorId, start, args, opt_duration,
opt_cpuStart, opt_cpuDuration, opt_argsStripped, opt_bind... | javascript | function ThreadSlice(cat, title, colorId, start, args, opt_duration,
opt_cpuStart, opt_cpuDuration, opt_argsStripped,
opt_bind_id) {
Slice.call(this, cat, title, colorId, start, args, opt_duration,
opt_cpuStart, opt_cpuDuration, opt_argsStripped, opt_bind... | [
"function",
"ThreadSlice",
"(",
"cat",
",",
"title",
",",
"colorId",
",",
"start",
",",
"args",
",",
"opt_duration",
",",
"opt_cpuStart",
",",
"opt_cpuDuration",
",",
"opt_argsStripped",
",",
"opt_bind_id",
")",
"{",
"Slice",
".",
"call",
"(",
"this",
",",
... | A ThreadSlice represents an interval of time on a thread resource
with associated nesting slice information.
ThreadSlices are typically associated with a specific trace event pair on a
specific thread.
For example,
TRACE_EVENT_BEGIN1("x","myArg", 7) at time=0.1ms
TRACE_EVENT_END0() at time=0.3ms
This r... | [
"A",
"ThreadSlice",
"represents",
"an",
"interval",
"of",
"time",
"on",
"a",
"thread",
"resource",
"with",
"associated",
"nesting",
"slice",
"information",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/thread_slice.js#L31-L39 | train |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/trace_event_importer.js | function(event, opt_slice) {
var thread = this.model_.getOrCreateProcess(event.pid).
getOrCreateThread(event.tid);
this.allFlowEvents_.push({
refGuid: tr.b.GUID.getLastGuid(),
sequenceNumber: this.allFlowEvents_.length,
event: event,
slice: opt_slice, // slice for ... | javascript | function(event, opt_slice) {
var thread = this.model_.getOrCreateProcess(event.pid).
getOrCreateThread(event.tid);
this.allFlowEvents_.push({
refGuid: tr.b.GUID.getLastGuid(),
sequenceNumber: this.allFlowEvents_.length,
event: event,
slice: opt_slice, // slice for ... | [
"function",
"(",
"event",
",",
"opt_slice",
")",
"{",
"var",
"thread",
"=",
"this",
".",
"model_",
".",
"getOrCreateProcess",
"(",
"event",
".",
"pid",
")",
".",
"getOrCreateThread",
"(",
"event",
".",
"tid",
")",
";",
"this",
".",
"allFlowEvents_",
".",... | Helper to process a flow event. | [
"Helper",
"to",
"process",
"a",
"flow",
"event",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/trace_event_importer.js#L237-L247 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/trace_event_importer.js | function(event) {
var ctr_name;
if (event.id !== undefined)
ctr_name = event.name + '[' + event.id + ']';
else
ctr_name = event.name;
var ctr = this.model_.getOrCreateProcess(event.pid)
.getOrCreateCounter(event.cat, ctr_name);
var reservedColorId = event.cname ?... | javascript | function(event) {
var ctr_name;
if (event.id !== undefined)
ctr_name = event.name + '[' + event.id + ']';
else
ctr_name = event.name;
var ctr = this.model_.getOrCreateProcess(event.pid)
.getOrCreateCounter(event.cat, ctr_name);
var reservedColorId = event.cname ?... | [
"function",
"(",
"event",
")",
"{",
"var",
"ctr_name",
";",
"if",
"(",
"event",
".",
"id",
"!==",
"undefined",
")",
"ctr_name",
"=",
"event",
".",
"name",
"+",
"'['",
"+",
"event",
".",
"id",
"+",
"']'",
";",
"else",
"ctr_name",
"=",
"event",
".",
... | Helper that creates and adds samples to a Counter object based on
'C' phase events. | [
"Helper",
"that",
"creates",
"and",
"adds",
"samples",
"to",
"a",
"Counter",
"object",
"based",
"on",
"C",
"phase",
"events",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/trace_event_importer.js#L253-L290 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/trace_event_importer.js | function() {
if (this.softwareMeasuredCpuCount_ !== undefined) {
this.model_.kernel.softwareMeasuredCpuCount =
this.softwareMeasuredCpuCount_;
}
this.createAsyncSlices_();
this.createFlowSlices_();
this.createExplicitObjects_();
this.createImplicitObjects_();
... | javascript | function() {
if (this.softwareMeasuredCpuCount_ !== undefined) {
this.model_.kernel.softwareMeasuredCpuCount =
this.softwareMeasuredCpuCount_;
}
this.createAsyncSlices_();
this.createFlowSlices_();
this.createExplicitObjects_();
this.createImplicitObjects_();
... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"softwareMeasuredCpuCount_",
"!==",
"undefined",
")",
"{",
"this",
".",
"model_",
".",
"kernel",
".",
"softwareMeasuredCpuCount",
"=",
"this",
".",
"softwareMeasuredCpuCount_",
";",
"}",
"this",
".",
"createAs... | Called by the Model after all other importers have imported their
events. | [
"Called",
"by",
"the",
"Model",
"after",
"all",
"other",
"importers",
"have",
"imported",
"their",
"events",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/trace_event_importer.js#L835-L845 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/trace_event_importer.js | concatenateArguments | function concatenateArguments(args1, args2) {
if (args1.params === undefined || args2.params === undefined)
return tr.b.concatenateObjects(args1, args2);
// Make an argument object to hold the combined params.
var args3 = {};
args3.params... | javascript | function concatenateArguments(args1, args2) {
if (args1.params === undefined || args2.params === undefined)
return tr.b.concatenateObjects(args1, args2);
// Make an argument object to hold the combined params.
var args3 = {};
args3.params... | [
"function",
"concatenateArguments",
"(",
"args1",
",",
"args2",
")",
"{",
"if",
"(",
"args1",
".",
"params",
"===",
"undefined",
"||",
"args2",
".",
"params",
"===",
"undefined",
")",
"return",
"tr",
".",
"b",
".",
"concatenateObjects",
"(",
"args1",
",",
... | Include args for both END and BEGIN for a matched pair. | [
"Include",
"args",
"for",
"both",
"END",
"and",
"BEGIN",
"for",
"a",
"matched",
"pair",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/trace_event_importer.js#L1070-L1078 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/heap_dump.js | HeapEntry | function HeapEntry(heapDump, leafStackFrame, size) {
this.heapDump = heapDump;
// The leaf stack frame of the associated backtrace (e.g. drawQuad for the
// drawQuad <- draw <- MessageLoop::RunTask backtrace). If undefined, the
// heap entry is a sum over all backtraces. On the other hand, an empty
... | javascript | function HeapEntry(heapDump, leafStackFrame, size) {
this.heapDump = heapDump;
// The leaf stack frame of the associated backtrace (e.g. drawQuad for the
// drawQuad <- draw <- MessageLoop::RunTask backtrace). If undefined, the
// heap entry is a sum over all backtraces. On the other hand, an empty
... | [
"function",
"HeapEntry",
"(",
"heapDump",
",",
"leafStackFrame",
",",
"size",
")",
"{",
"this",
".",
"heapDump",
"=",
"heapDump",
";",
"// The leaf stack frame of the associated backtrace (e.g. drawQuad for the",
"// drawQuad <- draw <- MessageLoop::RunTask backtrace). If undefined... | HeapEntry represents a single value describing the state of the heap of an
allocator in a single process.
An entry specifies how much space (e.g. 19 MiB) was allocated in a
particular context, which consists of a codepath (e.g. drawQuad <- draw <-
MessageLoop::RunTask).
@{constructor} | [
"HeapEntry",
"represents",
"a",
"single",
"value",
"describing",
"the",
"state",
"of",
"the",
"heap",
"of",
"an",
"allocator",
"in",
"a",
"single",
"process",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/heap_dump.js#L23-L34 | train |
googlearchive/node-big-rig | lib/third_party/tracing/extras/importer/linux_perf/kfunc_parser.js | KernelFuncParser | function KernelFuncParser(importer) {
LinuxPerfParser.call(this, importer);
importer.registerEventHandler('graph_ent',
KernelFuncParser.prototype.traceKernelFuncEnterEvent.
bind(this));
importer.registerEventHandler('graph_ret',
KernelFuncParser.prototype.traceKernelFuncReturnEv... | javascript | function KernelFuncParser(importer) {
LinuxPerfParser.call(this, importer);
importer.registerEventHandler('graph_ent',
KernelFuncParser.prototype.traceKernelFuncEnterEvent.
bind(this));
importer.registerEventHandler('graph_ret',
KernelFuncParser.prototype.traceKernelFuncReturnEv... | [
"function",
"KernelFuncParser",
"(",
"importer",
")",
"{",
"LinuxPerfParser",
".",
"call",
"(",
"this",
",",
"importer",
")",
";",
"importer",
".",
"registerEventHandler",
"(",
"'graph_ent'",
",",
"KernelFuncParser",
".",
"prototype",
".",
"traceKernelFuncEnterEvent... | Parses graph_ent and graph_ret events that were inserted by the Linux
kernel's function graph trace.
@constructor | [
"Parses",
"graph_ent",
"and",
"graph_ret",
"events",
"that",
"were",
"inserted",
"by",
"the",
"Linux",
"kernel",
"s",
"function",
"graph",
"trace",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/extras/importer/linux_perf/kfunc_parser.js#L24-L36 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/global_memory_dump.js | GlobalMemoryDump | function GlobalMemoryDump(model, start) {
tr.model.ContainerMemoryDump.call(this, start);
this.model = model;
this.processMemoryDumps = {};
} | javascript | function GlobalMemoryDump(model, start) {
tr.model.ContainerMemoryDump.call(this, start);
this.model = model;
this.processMemoryDumps = {};
} | [
"function",
"GlobalMemoryDump",
"(",
"model",
",",
"start",
")",
"{",
"tr",
".",
"model",
".",
"ContainerMemoryDump",
".",
"call",
"(",
"this",
",",
"start",
")",
";",
"this",
".",
"model",
"=",
"model",
";",
"this",
".",
"processMemoryDumps",
"=",
"{",
... | The GlobalMemoryDump represents a simultaneous memory dump of all
processes.
@constructor | [
"The",
"GlobalMemoryDump",
"represents",
"a",
"simultaneous",
"memory",
"dump",
"of",
"all",
"processes",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/global_memory_dump.js#L23-L27 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/global_memory_dump.js | function() {
// 1. Calculate not-owned and not-owning sub-sizes of all MADs
// (depth-first post-order traversal).
this.traverseAllocatorDumpsInDepthFirstPostOrder(
this.calculateDumpSubSizes_.bind(this));
// 2. Calculate owned and owning coefficients of owned and owner MADs
// ... | javascript | function() {
// 1. Calculate not-owned and not-owning sub-sizes of all MADs
// (depth-first post-order traversal).
this.traverseAllocatorDumpsInDepthFirstPostOrder(
this.calculateDumpSubSizes_.bind(this));
// 2. Calculate owned and owning coefficients of owned and owner MADs
// ... | [
"function",
"(",
")",
"{",
"// 1. Calculate not-owned and not-owning sub-sizes of all MADs",
"// (depth-first post-order traversal).",
"this",
".",
"traverseAllocatorDumpsInDepthFirstPostOrder",
"(",
"this",
".",
"calculateDumpSubSizes_",
".",
"bind",
"(",
"this",
")",
")",
";"... | Calculate the effective size of all memory allocator dumps in the dump
graph.
The effective size refers to the amount of memory a particular component
is using/consuming. In other words, every (reported) byte of used memory
is uniquely attributed to exactly one component. Consequently, unlike
size, effective size is c... | [
"Calculate",
"the",
"effective",
"size",
"of",
"all",
"memory",
"allocator",
"dumps",
"in",
"the",
"dump",
"graph",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/global_memory_dump.js#L303-L323 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/global_memory_dump.js | function(dump) {
// Completely skip dumps with undefined size.
if (!hasSize(dump))
return;
// We only need to consider owned dumps.
if (dump.ownedBy.length === 0)
return;
// Sort the owners in decreasing order of ownership importance and
// increasing order of not-o... | javascript | function(dump) {
// Completely skip dumps with undefined size.
if (!hasSize(dump))
return;
// We only need to consider owned dumps.
if (dump.ownedBy.length === 0)
return;
// Sort the owners in decreasing order of ownership importance and
// increasing order of not-o... | [
"function",
"(",
"dump",
")",
"{",
"// Completely skip dumps with undefined size.",
"if",
"(",
"!",
"hasSize",
"(",
"dump",
")",
")",
"return",
";",
"// We only need to consider owned dumps.",
"if",
"(",
"dump",
".",
"ownedBy",
".",
"length",
"===",
"0",
")",
"r... | Calculate owned and owning coefficients of a memory allocator dump and
its owners.
The owning coefficient refers to the proportion of a dump's not-owning
sub-size which is attributed to the dump (only relevant to owning MADs).
Conversely, the owned coefficient is the proportion of a dump's
not-owned sub-size, which is... | [
"Calculate",
"owned",
"and",
"owning",
"coefficients",
"of",
"a",
"memory",
"allocator",
"dump",
"and",
"its",
"owners",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/global_memory_dump.js#L454-L526 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/global_memory_dump.js | function(dump) {
// Completely skip dumps with undefined size. As a result, each dump will
// have defined effective size if and only if it has defined size.
if (!hasSize(dump)) {
// The rest of the pipeline relies on effective size being either a
// valid ScalarAttribute, or undefined... | javascript | function(dump) {
// Completely skip dumps with undefined size. As a result, each dump will
// have defined effective size if and only if it has defined size.
if (!hasSize(dump)) {
// The rest of the pipeline relies on effective size being either a
// valid ScalarAttribute, or undefined... | [
"function",
"(",
"dump",
")",
"{",
"// Completely skip dumps with undefined size. As a result, each dump will",
"// have defined effective size if and only if it has defined size.",
"if",
"(",
"!",
"hasSize",
"(",
"dump",
")",
")",
"{",
"// The rest of the pipeline relies on effectiv... | Calculate the effective size of a memory allocator dump.
In order to simplify the (already complex) calculation, we use the fact
that effective size is cumulative (unlike regular size), i.e. the
effective size of a non-leaf node is equal to the sum of effective sizes
of its children. The effective size of a leaf MAD i... | [
"Calculate",
"the",
"effective",
"size",
"of",
"a",
"memory",
"allocator",
"dump",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/global_memory_dump.js#L613-L675 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/global_memory_dump.js | function(fn) {
var visitedDumps = new WeakSet();
var openDumps = new WeakSet();
function visit(dump) {
if (visitedDumps.has(dump))
return;
if (openDumps.has(dump))
throw new Error(dump.userFriendlyName + ' contains a cycle');
openDumps.add(dump);
... | javascript | function(fn) {
var visitedDumps = new WeakSet();
var openDumps = new WeakSet();
function visit(dump) {
if (visitedDumps.has(dump))
return;
if (openDumps.has(dump))
throw new Error(dump.userFriendlyName + ' contains a cycle');
openDumps.add(dump);
... | [
"function",
"(",
"fn",
")",
"{",
"var",
"visitedDumps",
"=",
"new",
"WeakSet",
"(",
")",
";",
"var",
"openDumps",
"=",
"new",
"WeakSet",
"(",
")",
";",
"function",
"visit",
"(",
"dump",
")",
"{",
"if",
"(",
"visitedDumps",
".",
"has",
"(",
"dump",
... | Traverse the memory dump graph in a depth first post-order, i.e.
children and owners of a memory allocator dump are visited before the
dump itself. This method will throw an exception if the graph contains
a cycle. | [
"Traverse",
"the",
"memory",
"dump",
"graph",
"in",
"a",
"depth",
"first",
"post",
"-",
"order",
"i",
".",
"e",
".",
"children",
"and",
"owners",
"of",
"a",
"memory",
"allocator",
"dump",
"are",
"visited",
"before",
"the",
"dump",
"itself",
".",
"This",
... | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/global_memory_dump.js#L753-L781 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/global_memory_dump.js | function(fn) {
var visitedDumps = new WeakSet();
function visit(dump) {
if (visitedDumps.has(dump))
return;
// If this dumps owns another dump which hasn't been visited yet, then
// wait for this dump to be visited later.
if (dump.owns !== undefined && !visitedDum... | javascript | function(fn) {
var visitedDumps = new WeakSet();
function visit(dump) {
if (visitedDumps.has(dump))
return;
// If this dumps owns another dump which hasn't been visited yet, then
// wait for this dump to be visited later.
if (dump.owns !== undefined && !visitedDum... | [
"function",
"(",
"fn",
")",
"{",
"var",
"visitedDumps",
"=",
"new",
"WeakSet",
"(",
")",
";",
"function",
"visit",
"(",
"dump",
")",
"{",
"if",
"(",
"visitedDumps",
".",
"has",
"(",
"dump",
")",
")",
"return",
";",
"// If this dumps owns another dump which... | Traverse the memory dump graph in a depth first pre-order, i.e.
children and owners of a memory allocator dump are visited after the
dump itself. This method will not visit some dumps if the graph contains
a cycle. | [
"Traverse",
"the",
"memory",
"dump",
"graph",
"in",
"a",
"depth",
"first",
"pre",
"-",
"order",
"i",
".",
"e",
".",
"children",
"and",
"owners",
"of",
"a",
"memory",
"allocator",
"dump",
"are",
"visited",
"after",
"the",
"dump",
"itself",
".",
"This",
... | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/global_memory_dump.js#L789-L820 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/model_indices.js | ModelIndices | function ModelIndices(model) {
// For now the only indices we construct are for flowEvents
this.flowEventsById_ = {};
model.flowEvents.forEach(function(fe) {
if (fe.id !== undefined) {
if (!this.flowEventsById_.hasOwnProperty(fe.id)) {
this.flowEventsById_[fe.id] = new Array();
... | javascript | function ModelIndices(model) {
// For now the only indices we construct are for flowEvents
this.flowEventsById_ = {};
model.flowEvents.forEach(function(fe) {
if (fe.id !== undefined) {
if (!this.flowEventsById_.hasOwnProperty(fe.id)) {
this.flowEventsById_[fe.id] = new Array();
... | [
"function",
"ModelIndices",
"(",
"model",
")",
"{",
"// For now the only indices we construct are for flowEvents",
"this",
".",
"flowEventsById_",
"=",
"{",
"}",
";",
"model",
".",
"flowEvents",
".",
"forEach",
"(",
"function",
"(",
"fe",
")",
"{",
"if",
"(",
"f... | A Event Index maps an id to all the events that have that particular id
@constructor | [
"A",
"Event",
"Index",
"maps",
"an",
"id",
"to",
"all",
"the",
"events",
"that",
"have",
"that",
"particular",
"id"
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/model_indices.js#L20-L31 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/async_slice_group.js | AsyncSliceGroup | function AsyncSliceGroup(parentContainer, opt_name) {
tr.model.EventContainer.call(this);
this.parentContainer_ = parentContainer;
this.slices = [];
this.name_ = opt_name;
this.viewSubGroups_ = undefined;
} | javascript | function AsyncSliceGroup(parentContainer, opt_name) {
tr.model.EventContainer.call(this);
this.parentContainer_ = parentContainer;
this.slices = [];
this.name_ = opt_name;
this.viewSubGroups_ = undefined;
} | [
"function",
"AsyncSliceGroup",
"(",
"parentContainer",
",",
"opt_name",
")",
"{",
"tr",
".",
"model",
".",
"EventContainer",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"parentContainer_",
"=",
"parentContainer",
";",
"this",
".",
"slices",
"=",
"[",
... | A group of AsyncSlices associated with a thread.
@constructor
@extends {tr.model.EventContainer} | [
"A",
"group",
"of",
"AsyncSlices",
"associated",
"with",
"a",
"thread",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/async_slice_group.js#L23-L29 | train |
googlearchive/node-big-rig | lib/third_party/tracing/model/async_slice_group.js | function(amount) {
for (var sI = 0; sI < this.slices.length; sI++) {
var slice = this.slices[sI];
slice.start = (slice.start + amount);
// Shift all nested subSlices recursively.
var shiftSubSlices = function(subSlices) {
if (subSlices === undefined || subSlices.length ==... | javascript | function(amount) {
for (var sI = 0; sI < this.slices.length; sI++) {
var slice = this.slices[sI];
slice.start = (slice.start + amount);
// Shift all nested subSlices recursively.
var shiftSubSlices = function(subSlices) {
if (subSlices === undefined || subSlices.length ==... | [
"function",
"(",
"amount",
")",
"{",
"for",
"(",
"var",
"sI",
"=",
"0",
";",
"sI",
"<",
"this",
".",
"slices",
".",
"length",
";",
"sI",
"++",
")",
"{",
"var",
"slice",
"=",
"this",
".",
"slices",
"[",
"sI",
"]",
";",
"slice",
".",
"start",
"... | Shifts all the timestamps inside this group forward by the amount
specified, including all nested subSlices if there are any. | [
"Shifts",
"all",
"the",
"timestamps",
"inside",
"this",
"group",
"forward",
"by",
"the",
"amount",
"specified",
"including",
"all",
"nested",
"subSlices",
"if",
"there",
"are",
"any",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/async_slice_group.js#L75-L90 | train | |
googlearchive/node-big-rig | lib/third_party/tracing/model/async_slice_group.js | function(subSlices) {
if (subSlices === undefined || subSlices.length === 0)
return;
for (var sJ = 0; sJ < subSlices.length; sJ++) {
subSlices[sJ].start += amount;
shiftSubSlices(subSlices[sJ].subSlices);
}
} | javascript | function(subSlices) {
if (subSlices === undefined || subSlices.length === 0)
return;
for (var sJ = 0; sJ < subSlices.length; sJ++) {
subSlices[sJ].start += amount;
shiftSubSlices(subSlices[sJ].subSlices);
}
} | [
"function",
"(",
"subSlices",
")",
"{",
"if",
"(",
"subSlices",
"===",
"undefined",
"||",
"subSlices",
".",
"length",
"===",
"0",
")",
"return",
";",
"for",
"(",
"var",
"sJ",
"=",
"0",
";",
"sJ",
"<",
"subSlices",
".",
"length",
";",
"sJ",
"++",
")... | Shift all nested subSlices recursively. | [
"Shift",
"all",
"nested",
"subSlices",
"recursively",
"."
] | 71748aab8ea166726356c6578a6a1c82e314ca33 | https://github.com/googlearchive/node-big-rig/blob/71748aab8ea166726356c6578a6a1c82e314ca33/lib/third_party/tracing/model/async_slice_group.js#L80-L87 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.