Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: variable names cleanup #1536

Merged
merged 4 commits into from
Sep 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions examples/tracer-web/examples/fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@ const getData = (url) => fetch(url, {

// example of keeping track of context between async operations
const prepareClickEvent = () => {
const url1 = 'https://httpbin.org/get';
const url = 'https://httpbin.org/get';

const element = document.getElementById('button1');

const onClick = () => {
const span1 = webTracerWithZone.startSpan(`files-series-info`, {
const singleSpan = webTracerWithZone.startSpan(`files-series-info`, {
parent: webTracerWithZone.getCurrentSpan(),
});
webTracerWithZone.withSpan(span1, () => {
getData(url1).then((_data) => {
webTracerWithZone.getCurrentSpan().addEvent('fetching-span1-completed');
span1.end();
webTracerWithZone.withSpan(singleSpan, () => {
getData(url).then((_data) => {
webTracerWithZone.getCurrentSpan().addEvent('fetching-single-span-completed');
singleSpan.end();
});
});
for (let i = 0, j = 5; i < j; i += 1) {
const span1 = webTracerWithZone.startSpan(`files-series-info-${i}`, {
const span = webTracerWithZone.startSpan(`files-series-info-${i}`, {
parent: webTracerWithZone.getCurrentSpan(),
});
webTracerWithZone.withSpan(span1, () => {
getData(url1).then((_data) => {
webTracerWithZone.getCurrentSpan().addEvent('fetching-span1-completed');
span1.end();
webTracerWithZone.withSpan(span, () => {
getData(url).then((_data) => {
webTracerWithZone.getCurrentSpan().addEvent(`fetching-span-${i}-completed`);
span.end();
});
});
}
Expand Down