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

Display Node and Doctor version in generated Doctor view #324

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Display Node and Doctor version in generated Doctor view #324

wants to merge 18 commits into from

Conversation

ConorDavenport
Copy link
Contributor

No description provided.

index.js Outdated
.on('end', () => {
fs.writeFile(systemInfoPath, chunks.toString(), 'utf-8', function () {
})
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this instead of just copying the file? The other (and more efficient way of doing this if it's really needed is to just pipe from one stream to another...)

const in = fs.createReadStream(paths['/systeminfo'])
const out = fs.createWriteStream(systemInfoPath)
stream.pipeline(in, out, (err) => {
  if (err) /** handle the error **/
})

Copy link
Contributor

Choose a reason for hiding this comment

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

Really tho, I'm just not sure why this copy is necessary at all

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I see that, it's not a very good solution, it was originally a problem with accessing the data file. But I've updated it there.

@jasnell
Copy link
Contributor

jasnell commented Apr 24, 2020

Good start. Please also be sure to include the command line arguments used to launch clinic

@goto-bus-stop
Copy link
Contributor

We can add the necessary systemInfo data to the dataFile value here:
https://github.com/nearform/node-clinic-doctor/blob/0d5e9aabec6356b4051b59a7571e1aad10ea7a87/index.js#L205-L211
which will make it available in this callback in the visualizer:
https://github.com/nearform/node-clinic-doctor/blob/0d5e9aabec6356b4051b59a7571e1aad10ea7a87/visualizer/main.js#L90

@ConorDavenport ConorDavenport marked this pull request as ready for review April 27, 2020 14:35
Copy link
Contributor

@goto-bus-stop goto-bus-stop left a comment

Choose a reason for hiding this comment

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

oops…had review comments still in the queue…don't know if you'll have time for this anymore, no matter either way :)

index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@jasnell jasnell changed the base branch from master to main August 21, 2020 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants