Skip to content

Commit

Permalink
chore: variable names cleanup (#1536)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
  • Loading branch information
DarkPurple141 and dyladan committed Sep 22, 2020
1 parent 9b3ff19 commit bc9244f
Showing 1 changed file with 11 additions and 11 deletions.
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

0 comments on commit bc9244f

Please sign in to comment.