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

Reformat the critical chain output #1647

Merged
merged 2 commits into from
Feb 15, 2017
Merged

Reformat the critical chain output #1647

merged 2 commits into from
Feb 15, 2017

Conversation

paulirish
Copy link
Member

Some upgrades to this little guy to make it more concise.

  • Put most of the details in a details/summary so its not too loud in the report
  • The 3 "longest chain" stats from the top were looking at (potentially) 3 individual chains. I changed it to pick the winner based on total duration, and then report the req count & kb size total from it as well.
  • Formatting for "initial navigation" in HTML so its clear it belongs to the ascii art.
  • toLocaleString() so we have thousands separator.
  • Time durations (ms) reported with 1 decimal place. File sizes (kb) remain at 2 places.

Screenshots:

before after
image image

@@ -89,7 +95,8 @@
<span class="cnc-node__tree-hostname">({{ this.hostname }})</span>
{{/parseURL}}
{{#unless hasChildren}}
- <span class="cnc-node__chain-duration">{{chainDuration startTime this.node.request.endTime }}ms, {{formatTransferSize this.transferSize}}KB</span>
- <span class="cnc-node__chain-duration">{{chainDuration startTime this.node.request.endTime }}ms</span>,
<span class="cnc-node__chain-duration">{{formatTransferSize this.transferSize}}KB</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: not really chain-duration, why was it split into two spans? or maybe use a new chain-size modified or something?

Copy link
Member Author

Choose a reason for hiding this comment

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

split into two so that the comma wasn't bolded. and yah im lazily not adjusting the classname. i could.

Copy link
Collaborator

Choose a reason for hiding this comment

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

gotcha, nah not a big deal

longestChainDuration = duration;
if (duration > longest.duration) {
longest.duration = duration;
longest.transferSize = opts.chainTransferSize;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this was outstanding, but why does this chainTransferSize not include the size of the file that pushed the chain out farthest? the duration is pulled from the youtube base.js in the screenshot which is ~430kb and larger than the entire chain size of ~390kb

Copy link
Member Author

Choose a reason for hiding this comment

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

good question. mind if i break this into a separate issue?

` - Longest chain duration (shorter is better): ${longestDuration}ms\n` +
` - Longest chain transfer size (smaller is better): ${longestTransferSize}KB\n` +
const output = ` - Longest request chain: ${longestDuration}ms` +
` over ${longestChain } requests, totalling ${longestTransferSize}KB\n` +
Copy link
Contributor

Choose a reason for hiding this comment

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

nit extra spacing: ${longestChain}

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -55,6 +55,12 @@
color: #999;
}

.initial-nav {
Copy link
Contributor

Choose a reason for hiding this comment

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

we'll need to add this to the .css file when #1652 lands.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@paulirish paulirish merged commit e72aadc into master Feb 15, 2017
@paulirish paulirish deleted the critchainreformat branch February 15, 2017 00:01
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.

None yet

3 participants