2023-04-10 15:36:59 +00:00
|
|
|
{{!
|
|
|
|
Copyright (c) HashiCorp, Inc.
|
|
|
|
SPDX-License-Identifier: MPL-2.0
|
|
|
|
}}
|
|
|
|
|
2021-03-22 07:46:37 +00:00
|
|
|
<div data-test-primary-metric class="primary-metric" ...attributes
|
2021-03-16 02:47:54 +00:00
|
|
|
{{did-insert this.start}}
|
|
|
|
{{did-update this.start}}>
|
|
|
|
<h4 data-test-primary-metric-title class="title is-5">
|
|
|
|
{{#if (eq this.metric "cpu")}} CPU
|
|
|
|
{{else if (eq this.metric "memory")}} Memory
|
|
|
|
{{else}} {{this.metric}} {{/if}}
|
|
|
|
</h4>
|
|
|
|
<div class="primary-graphic">
|
2021-03-22 06:02:28 +00:00
|
|
|
<StatsTimeSeries @data={{this.series}} @dataProp="data" >
|
2021-03-16 02:47:54 +00:00
|
|
|
<:svg as |c|>
|
|
|
|
{{#each (reverse this.series) as |series idx|}}
|
2021-05-03 15:36:18 +00:00
|
|
|
<c.Area
|
|
|
|
@data={{series.data}}
|
|
|
|
@colorScale={{this.colorScale}}
|
|
|
|
@index={{idx}}
|
|
|
|
data-test-task-name={{series.name}} />
|
2021-03-16 02:47:54 +00:00
|
|
|
{{/each}}
|
|
|
|
</:svg>
|
|
|
|
<:after as |c|>
|
|
|
|
<c.Tooltip class="is-snappy" as |series datum idx|>
|
|
|
|
<li>
|
|
|
|
<span class="label"><span class="color-swatch swatch-{{this.colorScale}} swatch-{{this.colorScale}}-{{idx}}" />{{series.name}}</span>
|
|
|
|
{{#if (eq this.metric "cpu")}}
|
2021-03-29 23:16:48 +00:00
|
|
|
<span class="value">{{format-scheduled-hertz datum.datum.used}}</span>
|
2021-03-16 02:47:54 +00:00
|
|
|
{{else if (eq this.metric "memory")}}
|
2021-03-26 17:24:46 +00:00
|
|
|
<span class="value">{{format-scheduled-bytes datum.datum.used}}</span>
|
2021-03-16 02:47:54 +00:00
|
|
|
{{else}}
|
|
|
|
<span class="value">{{datum.formatttedY}}</span>
|
|
|
|
{{/if}}
|
|
|
|
</li>
|
|
|
|
</c.Tooltip>
|
|
|
|
</:after>
|
|
|
|
</StatsTimeSeries>
|
|
|
|
</div>
|
|
|
|
<PrimaryMetric::CurrentValue @chartClass={{this.chartClass}} @percent={{this.data.lastObject.percent}} />
|
|
|
|
<div class="annotation" data-test-absolute-value>
|
|
|
|
{{#if (eq this.metric "cpu")}}
|
2021-03-29 23:16:48 +00:00
|
|
|
<strong>{{format-scheduled-hertz this.data.lastObject.used}}</strong> / {{format-scheduled-hertz this.reservedAmount}} Total
|
2021-03-16 02:47:54 +00:00
|
|
|
{{else if (eq this.metric "memory")}}
|
2021-03-27 00:02:54 +00:00
|
|
|
<strong>{{format-scheduled-bytes this.data.lastObject.used}}</strong> / {{format-scheduled-bytes this.reservedAmount start="MiB"}} Total
|
2021-03-16 02:47:54 +00:00
|
|
|
{{else}}
|
|
|
|
<strong>{{this.data.lastObject.used}}</strong> / {{this.reservedAmount}} Total
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|