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

Site.js: remove site generation profiling #748

Merged
merged 2 commits into from
Mar 7, 2019

Conversation

tawAsh1
Copy link
Contributor

@tawAsh1 tawAsh1 commented Mar 3, 2019

What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [X] Bug fix

Fixes #738

What changes did you make? (Give an overview)
Get rid of the logger.profile()
use Date() and show generate time on debug level

Copy link
Contributor

@acjh acjh left a comment

Choose a reason for hiding this comment

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

Hi Hiroki, thank you for your contribution!

src/Site.js Outdated
.finally(() => {
const endTime = new Date();
const totalBuildTime = endTime - startTime;
logger.debug(`Total generation time: ${totalBuildTime}ms`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's:

  1. rename this variable to totalGenerationTime.
  2. use seconds, to be consistent with the existing totalBuildTime.
  3. remove the profile export in logger.js.

Copy link
Member

Choose a reason for hiding this comment

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

Should we downgrade the profile logging in logger.js#profile() instead, like so:

logger.profile('test', { level: 'debug' });

Otherwise, if we are not planning to do any extensive profiling in the future, there's not really a reason for this portion of the code to stay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems necessary to upgrade the version of logger (winston) from 2 to 3 in order to execute that code. logger.profile('test', { level: 'debug' });
https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md

Copy link
Member

Choose a reason for hiding this comment

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

Let's just get rid of this part of the code then.

@yamgent
Copy link
Member

yamgent commented Mar 6, 2019

Your first post and PR title will need to be updated, the PR title can be Site.js: remove site generation profiling?

@tawAsh1 tawAsh1 changed the title show generate time on debug level Site.js: remove site generation profiling Mar 6, 2019
@tawAsh1
Copy link
Contributor Author

tawAsh1 commented Mar 6, 2019

Title updated

@yamgent yamgent added this to the v1.19.3 milestone Mar 7, 2019
@yamgent yamgent merged commit 3a41c7f into MarkBind:master Mar 7, 2019
@tawAsh1
Copy link
Contributor Author

tawAsh1 commented Mar 7, 2019

Thank you for your reviews. 🙇

yamgent pushed a commit to yamgent/markbind that referenced this pull request Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix missing space in log output
3 participants