Skip to content

Commit

Permalink
Only attempt to load graphs when data is available
Browse files Browse the repository at this point in the history
  • Loading branch information
bwalkerl committed Sep 13, 2024
1 parent 12ef2cd commit bfc9b28
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
13 changes: 11 additions & 2 deletions templates/flamegraph.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,31 @@
Context variables required for this template:
* id - The id of the profile
* locale - Language setting (a BCP 47 language tag)
* flamedatad3 - Flame data, only used to determine if a graph can be displayed.
Example context (json):
{
"id" : 3,
"locale" : "en"
"locale" : "en",
"flamedatad3": "true"
}
}}

<h4>Profile Flame Graph</h4>

<div id="loading">
Loading...
{{#flamedatad3}}
Loading...
{{/flamedatad3}}
{{^flamedatad3}}
No profile flame data is available.
{{/flamedatad3}}
</div>

<div id="flamechart" style="margin-top: 1rem;"></div>
<div id="flamedetails" style="min-height: 1.5rem; clear: both;"></div>

{{#flamedatad3}}
<script>
init();
Expand Down Expand Up @@ -142,3 +150,4 @@ function resetZoom() {
}
}
</script>
{{/flamedatad3}}
15 changes: 12 additions & 3 deletions templates/memoryusagegraph.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,31 @@
Context variables required for this template:
* id - The id of the profile
* locale - Language setting (a BCP 47 language tag)
* memoryusagedatad3 - Memory usage data, only used to determine if a graph can be displayed.
Example context (json):
{
"id" : 3,
"locale": "en"
"locale": "en",
"memoryusagedatad3": "true"
}
}}

<h4>Memory Usage</h4>

<div id="loadingmemoryusagegraph">
Loading...
{{#memoryusagedatad3}}
Loading...
{{/memoryusagedatad3}}
{{^memoryusagedatad3}}
No memory usage data is available.
{{/memoryusagedatad3}}
</div>

<div id="memoryusagegraph" style="margin-top: 1rem;"></div>
<div id="memoryusagedetails" style="min-height: 1.5rem; clear: both;"></div>

{{#memoryusagedatad3}}
<script>
/**
Expand Down Expand Up @@ -204,4 +212,5 @@ function processGraph(id, data) {
}
</script>
</script>
{{/memoryusagedatad3}}

0 comments on commit bfc9b28

Please sign in to comment.