Skip to content

Commit c4eda6d

Browse files
committed
Added Scroll down information
1 parent f092c3f commit c4eda6d

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

details.html

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,24 @@ <h2 class="ui image header">
3333
<h1 id="website-name" class="ui massive teal ribbon label"></h1>
3434
<p style="margin-left: 0; margin-top: 10px; text-align: left;">Tested on <span id="last-run-date"></span></p>
3535
<hr>
36-
<div style="display: flex; gap: 20px;">
37-
<div id="rendering-energy-label" style="white-space: nowrap;"></div>
38-
<div>
39-
<h2 style="display: inline-block; margin-bottom: 0px;">Rendering Energy</h2>
40-
<p>The CPU power consumption for rendering was <span id="rendering-power" class="ui label"></span></p>
41-
<p>With an initial load and then waiting for 5s the total visit time was: <span class="ui label measurement-duration"></span></p>
42-
<p>This equates to an energy of: <span id="rendering-energy" class="ui label"></span></p>
43-
<p>If you have 10,000 people visiting your page per month this would consume <span id="rendering-energy-10k" class="ui label"></span></p>
44-
</div>
36+
<div id="rendering-energy-label" style="white-space: nowrap;"></div>
37+
<div>
38+
<h2 style="display: inline-block; margin-bottom: 0px;">Rendering Energy</h2>
39+
<p>The CPU power consumption for rendering was <span id="rendering-power" class="ui label"></span></p>
40+
<p>With an initial load and then waiting for 5s the total visit time was: <span class="ui label measurement-duration"></span></p>
41+
<p>This equates to an energy of: <span id="rendering-energy" class="ui label"></span></p>
42+
<p>If you have 10,000 people visiting your page per month this would consume <span id="rendering-energy-10k" class="ui label"></span></p>
4543
</div>
4644
<hr>
47-
<div style="display: flex; gap: 20px;">
48-
<div id="network-transfer-label" style="white-space: nowrap;"></div>
49-
<div>
50-
<h2 style="display: inline-block; margin-bottom: 0px;">Network Data</h2>
51-
<p>The network data transfer the website was <span id="network-transfer" class="ui label"></span> for loading and staying on the page for <span class="ui label measurement-duration"></span></p>
52-
<p>Assuming you have 10,000 visitors per month this website would produce about <span id="network-carbon-10k-year" class="ui label"> per year</p>
53-
</div>
54-
</div>
45+
<div id="network-transfer-label" style="white-space: nowrap;"></div>
46+
<h2 style="display: inline-block; margin-bottom: 0px;">Network Data</h2>
47+
<p>The network data transfer the website was <span id="network-transfer" class="ui label"></span> for loading and staying on the page for <span class="ui label measurement-duration"></span></p>
48+
<p>Assuming you have 10,000 visitors per month this website would produce about <span id="network-carbon-10k-year" class="ui label"> per year</p>
49+
<hr>
50+
<h3>What about scrolling?</h3>
51+
<p>A page can download way more resources when scrolling down. Also some energy intensive rendering elements can be below the fold.</p>
52+
<p>However scrolling is hard to compare as some pages have infinite scrolling and some don't.</p>
53+
<p>Thus webNRG⚡️ <i>does</i> check scrolling energy but is <i>only displayed</i> in the <a id="measurement-details-link-scroll" href="" target="_blank" rel="noopener">Green Metrics Tool Detail View</a>. Click on the <i>Scroll down and wait for 5 s</i> tab.</p>
5554
<hr>
5655
<h3>History and more details</h3>
5756
<ul>

js/details.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
document.querySelector('#network-carbon-10k-year').textContent = `${(network_carbon_10k_kg).toFixed(2)} kg`;
6363

6464
document.querySelector('#measurement-details-link').href = `https://metrics.green-coding.io/stats.html?id=${uuid}`;
65+
document.querySelector('#measurement-details-link-scroll').href = `https://metrics.green-coding.io/stats.html?id=${uuid}#RUNTIME__Scroll%20down%20and%20wait%20for%205%20s`;
6566
document.querySelector('#timeline-link').href = `https://metrics.green-coding.io/timeline.html?uri=https%3A%2F%2Fgithub.com%2Fgreen-coding-solutions%2Fgreen-metrics-tool&branch=main&machine_id=6&filename=templates%2Fwebsite%2Fusage_scenario_cached.yml&usage_scenario_variables=${encodeURIComponent(usage_scenario_variables_json)}&metrics=key`;
6667

6768
})()

0 commit comments

Comments
 (0)