Skip to content

Commit 6bd03c9

Browse files
committed
util page content
1 parent 83f47be commit 6bd03c9

File tree

1 file changed

+16
-51
lines changed
  • src/routes/team/[team]/[env]/app/[app]/utilization

1 file changed

+16
-51
lines changed

src/routes/team/[team]/[env]/app/[app]/utilization/+page.svelte

+16-51
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import GraphErrors from '$lib/GraphErrors.svelte';
55
import type { EChartsOption } from 'echarts';
66
7-
import { UtilizationResourceType } from '$houdini';
8-
import { euroValueFormatter } from '$lib/chart/cost_transformer';
9-
import { cpuUtilization, memoryUtilization, yearlyOverageCost } from '$lib/utils/resources';
107
import { changeParams } from '$lib/utils/searchparams';
118
import {
129
BodyLong,
@@ -181,54 +178,37 @@
181178
<GraphErrors errors={$ResourceUtilizationForApp.errors} />
182179

183180
<div class="wrapper">
181+
<Heading size="medium" level="2">Analyzing Your Resource Usage</Heading>
184182
<BodyLong>
185-
These graphs help you analyze your app's CPU and memory usage over time.
183+
These graphs show your application's CPU and memory usage.
186184
<ul>
187-
<li>Blue Line (Requests): The guaranteed CPU or memory allocation for your app.</li>
188-
<li>Red Line (Limits, if present): The maximum allowed usage before restrictions apply.</li>
189-
<li>Shaded Area: The actual resource consumption over time.</li>
185+
<li>Blue Line (Requests): The minimum CPU or memory guaranteed to your app.</li>
186+
<li>Red Line (Limits, if present): The maximum CPU or memory your app can use.</li>
187+
<li>
188+
Shaded Areas: The actual resource consumption over time for each running instance of your
189+
app.
190+
</li>
190191
</ul>
191-
Your app can exceed the request line, which is expected if additional resources are available:
192+
Your app can use more than its requested amount if resources are available.
192193
<ul>
193194
<li>
194-
For CPU: Exceeding requests may cause throttling, leading to reduced performance but no
195-
crashes.
195+
CPU: Exceeding requests might cause <strong>throttling</strong>, potentially reducing
196+
performance.
196197
</li>
197198
<li>
198-
For Memory: Exceeding the limit causes termination (OOMKilled) because memory cannot be
199-
throttled.
199+
Memory: Exceeding the limit will cause that specific app instance to be terminated
200+
(OOMKilled).
200201
</li>
201202
</ul>
202-
<div>To optimize costs while maintaining performance:</div>
203+
<div><strong>Optimize your resource settings:</strong></div>
203204
<div>✅ If usage is consistently below requests, consider lowering requests to save money.</div>
204205
<div>✅ If CPU usage is frequently throttled, increasing requests may improve performance.</div>
205-
<div>
206-
✅ If memory usage hits the limit, increasing requests or optimizing memory use may prevent
207-
crashes.
208-
</div>
209206
</BodyLong>
210207
<div class="section">
211208
<Heading level="2" size="medium" spacing>Memory usage</Heading>
212209
{#if $ResourceUtilizationForApp.data}
213210
{@const utilization =
214211
$ResourceUtilizationForApp.data.team.environment.application.utilization}
215-
<BodyLong spacing>
216-
At the latest data point, usage is {(
217-
memoryUtilization(utilization.requested_memory, utilization.current_memory) * 100
218-
).toFixed(0)}% of {prettyBytes(utilization.requested_memory, {
219-
locale: 'en',
220-
minimumFractionDigits: 2,
221-
maximumFractionDigits: 2,
222-
binary: true
223-
})} requested memory. Based on this data point, the estimated annual cost of unused memory of
224-
{euroValueFormatter(
225-
yearlyOverageCost(
226-
UtilizationResourceType.MEMORY,
227-
utilization.requested_memory,
228-
utilization.current_memory
229-
)
230-
)}.
231-
</BodyLong>
232212
<div style="justify-self: end;">
233213
<ToggleGroup
234214
value={interval}
@@ -264,7 +244,7 @@
264244
/>
265245
</div>
266246
{:else}
267-
<div style="height: 436px; display: flex; justify-content: center; align-items: center;">
247+
<div style="height: 380px; display: flex; justify-content: center; align-items: center;">
268248
<Loader size="3xlarge" />
269249
</div>
270250
{/if}
@@ -274,21 +254,6 @@
274254
{#if $ResourceUtilizationForApp.data}
275255
{@const utilization =
276256
$ResourceUtilizationForApp.data.team.environment.application.utilization}
277-
<BodyLong spacing>
278-
At the latest data point, usage is {cpuUtilization(
279-
utilization.requested_cpu,
280-
utilization.current_cpu
281-
)}% of {utilization.requested_cpu.toLocaleString('en-GB', {
282-
minimumFractionDigits: 2,
283-
maximumFractionDigits: 2
284-
})} requested CPUs. Based on this data point, the estimated annual cost of unused CPU of {euroValueFormatter(
285-
yearlyOverageCost(
286-
UtilizationResourceType.CPU,
287-
utilization.requested_cpu,
288-
utilization.current_cpu
289-
)
290-
)}.
291-
</BodyLong>
292257
<div style="justify-self: end;">
293258
<ToggleGroup
294259
value={interval}
@@ -313,7 +278,7 @@
313278
/>
314279
</div>
315280
{:else}
316-
<div style="height: 436px; display: flex; justify-content: center; align-items: center;">
281+
<div style="height: 380px; display: flex; justify-content: center; align-items: center;">
317282
<Loader size="3xlarge" />
318283
</div>
319284
{/if}

0 commit comments

Comments
 (0)