Skip to content

docs: Update comments #2562

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

Merged
merged 1 commit into from
May 11, 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
4 changes: 2 additions & 2 deletions packages/apm/src/integrations/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ export class Tracing implements Integration {
logger.warn(`[Tracing] We added a reasonable default for you: ${defaultTracingOrigins}`);
}

// Starting our inital pageload transaction
// Starting pageload transaction
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of fixing the typo I decided for a shorter comment. I'd be even happier to remove it completely in favor of easier to read code.

Tracing.startIdleTransaction is not bad, but makes me wonder why is it called "idle" instead of "pageload".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in theory it can be used for other things besides just page load, and "idle" because it closes on idle timeout. I agree, though, that in the API review we're about to do, I'd like to reconsider the startIdleTransaction method name.

if (global.location && global.location.href) {
// `${global.location.href}` will be used a temp transaction name
// Use `${global.location.href}` as transaction name
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was once a "temporary name" seems to have settled as "the name" for now.

Also not sure how useful this comment is, if the code is not clear, we could refactor to introduce a descriptive constant:

const name = global.location.href;
Tracing.startPageloadTransaction(name, ...);

Tracing.startIdleTransaction(global.location.href, {
op: 'pageload',
});
Expand Down