};
this.chart.chart.update();
} else if (this.chart && this.data) {
- let maxValue = 0,
- maxValueDataUnits = '';
let maxValueData = Math.max(...this.data.map((values: any) => values[1]));
if (this.data2) {
var maxValueData2 = Math.max(...this.data2.map((values: any) => values[1]));
- [maxValue, maxValueDataUnits] = this.convertUnits(
- Math.max(maxValueData, maxValueData2)
- ).split(' ');
- } else {
- [maxValue, maxValueDataUnits] = this.convertUnits(Math.max(maxValueData)).split(' ');
}
+ let [maxValue, maxValueDataUnits] = this.convertUnits(
+ Math.max(maxValueData, maxValueData2)
+ ).split(' ');
this.chart.chart.options.scales.yAxes[0].ticks.suggestedMax = maxValue * 1.2;
this.chart.chart.options.scales.yAxes[0].ticks.suggestedMin = 0;
this.times = [
{
name: $localize`Last 5 minutes`,
- value: this.timeToDate(5 * 60, 1)
+ value: this.timeToDate(5 * 60)
},
{
name: $localize`Last 15 minutes`,
- value: this.timeToDate(15 * 60, 3)
+ value: this.timeToDate(15 * 60)
},
{
name: $localize`Last 30 minutes`,
- value: this.timeToDate(30 * 60, 6)
+ value: this.timeToDate(30 * 60)
},
{
name: $localize`Last 1 hour`,
- value: this.timeToDate(3600, 12)
+ value: this.timeToDate(3600)
},
{
name: $localize`Last 3 hours`,
- value: this.timeToDate(3 * 3600, 36)
+ value: this.timeToDate(3 * 3600)
},
{
name: $localize`Last 6 hours`,
- value: this.timeToDate(6 * 3600, 72)
+ value: this.timeToDate(6 * 3600, 30)
},
{
name: $localize`Last 12 hours`,
- value: this.timeToDate(12 * 3600, 144)
+ value: this.timeToDate(12 * 3600, 60)
},
{
name: $localize`Last 24 hours`,
- value: this.timeToDate(24 * 3600, 288)
+ value: this.timeToDate(24 * 3600, 120)
},
{
name: $localize`Last 2 days`,
- value: this.timeToDate(48 * 3600, 576)
+ value: this.timeToDate(48 * 3600, 300)
},
{
name: $localize`Last 7 days`,
- value: this.timeToDate(168 * 3600, 2016)
+ value: this.timeToDate(168 * 3600, 900)
}
];
this.time = this.times[3].value;
}
emitTime() {
- this.selectedTime.emit(this.timeToDate(this.time.end - this.time.start, this.time.step));
+ this.selectedTime.emit(this.time);
}
- private timeToDate(secondsAgo: number, step: number): any {
+ private timeToDate(secondsAgo: number, step: number = 30): any {
const date: number = moment().unix() - secondsAgo;
const dateNow: number = moment().unix();
const formattedDate: any = {
<cd-card title="Inventory"
i18n-title
class="col-sm-3 px-3 d-flex">
- <hr>
<!-- Hosts -->
- <li class="list-group-item">
+ <li class="border-top list-group-item">
<cd-card-row [data]="healthData.hosts"
link="/hosts"
title="Host"
summaryType="simplified"
*ngIf="healthData.hosts != null"></cd-card-row>
</li>
- <hr>
<!-- Monitors -->
- <li class="list-group-item">
+ <li class="border-top list-group-item">
<cd-card-row [data]="healthData.mon_status.monmap.mons.length"
link="/monitor"
title="Monitor"
summaryType="simplified"
*ngIf="healthData.mon_status"></cd-card-row>
</li>
- <hr>
<!-- Managers -->
<li *ngIf="healthData.mgr_map"
- class="list-group-item">
+ class="border-top list-group-item">
<cd-card-row [data]="healthData.mgr_map | mgrSummary"
link="/manager"
title="Manager"
*ngIf="healthData.mgr_map"></cd-card-row>
</li>
- <hr>
<!-- OSDs -->
- <li class="list-group-item">
+ <li class="border-top list-group-item">
<cd-card-row [data]="healthData.osd_map | osdSummary"
link="/osd"
title="OSD"
summaryType="osd"
*ngIf="healthData.osd_map"></cd-card-row>
</li>
- <hr>
<!-- Pools -->
<li *ngIf="healthData.pools"
- class="list-group-item">
+ class="border-top list-group-item">
<cd-card-row [data]="healthData.pools.length"
link="/pool"
title="Pool"
summaryType="simplified"
*ngIf="healthData.pools"></cd-card-row>
</li>
- <hr>
<!-- PG Info -->
- <li class="list-group-item">
+ <li class="border-top list-group-item">
<cd-card-row [data]="healthData.pg_info | pgSummary"
title="PG"
*ngIf="healthData.pg_info"></cd-card-row>
</li>
- <hr>
<!-- Object gateways -->
<li *ngIf="enabledFeature.rgw && healthData.rgw != null"
- class="list-group-item"
+ class="border-top list-group-item"
id="rgw-item">
<cd-card-row [data]="healthData.rgw"
link="/rgw/daemon"
summaryType="simplified"
*ngIf="healthData.rgw || healthData.rgw === 0 "></cd-card-row>
</li>
- <hr>
+
<!-- Metadata Servers -->
<li *ngIf="enabledFeature.cephfs && healthData.fs_map"
- class="list-group-item"
+ class="border-top list-group-item"
id="mds-item">
<cd-card-row [data]="healthData.fs_map | mdsSummary"
title="Metadata Server"
*ngIf="healthData.fs_map"></cd-card-row>
</li>
- <hr>
+
<!-- iSCSI Gateways -->
<li *ngIf="enabledFeature.iscsi && healthData.iscsi_daemons != null"
- class="list-group-item"
+ class="border-top list-group-item"
id="iscsi-item">
<cd-card-row [data]="healthData.iscsi_daemons"
link="/iscsi/daemon"
</ng-container>
<cd-dashboard-area-chart chartTitle="IOPS"
dataUnits="none"
- label="OPS"
- label2="IPS"
+ label="IPS"
+ label2="OPS"
[data]="queriesResults.OPS"
[data2]="queriesResults.IPS">
</cd-dashboard-area-chart>
[data]="queriesResults.READCLIENTTHROUGHPUT"
[data2]="queriesResults.WRITECLIENTTHROUGHPUT">
</cd-dashboard-area-chart>
- <cd-dashboard-area-chart chartTitle="Recovery Throughput"
- dataUnits="bytesPerSecond"
- label="Recovery Throughput"
- [data]="queriesResults.RECOVERYBYTES">
- </cd-dashboard-area-chart>
</div>
</cd-card>
</div>
READLATENCY: '',
WRITELATENCY: '',
READCLIENTTHROUGHPUT: '',
- WRITECLIENTTHROUGHPUT: '',
- RECOVERYBYTES: ''
+ WRITECLIENTTHROUGHPUT: ''
};
timerGetPrometheusDataSub: Subscription;
timerTime = 30000;
readonly lastHourDateObject = {
start: moment().unix() - 3600,
end: moment().unix(),
- step: 12
+ step: 30
};
constructor(
for (const queryName in queries) {
if (queries.hasOwnProperty(queryName)) {
- const query = queries[queryName];
- let interval = selectedTime.step;
-
- if (query.includes('rate') && selectedTime.step < 20) {
- interval = 20;
- } else if (query.includes('rate')) {
- interval = selectedTime.step * 2;
- }
-
- const intervalAdjustedQuery = query.replace(/\[(.*?)\]/g, `[${interval}s]`);
-
this.prometheusService
.getPrometheusData({
- params: intervalAdjustedQuery,
+ params: queries[queryName],
start: selectedTime['start'],
end: selectedTime['end'],
step: selectedTime['step']
export enum Promqls {
USEDCAPACITY = 'ceph_cluster_total_used_bytes',
- IPS = 'sum(rate(ceph_osd_op_w_in_bytes[$interval]))',
- OPS = 'sum(rate(ceph_osd_op_r_out_bytes[$interval]))',
- READLATENCY = 'avg_over_time(ceph_osd_apply_latency_ms[$interval])',
- WRITELATENCY = 'avg_over_time(ceph_osd_commit_latency_ms[$interval])',
- READCLIENTTHROUGHPUT = 'sum(rate(ceph_pool_rd_bytes[$interval]))',
- WRITECLIENTTHROUGHPUT = 'sum(rate(ceph_pool_wr_bytes[$interval]))',
- RECOVERYBYTES = 'sum(rate(ceph_osd_recovery_bytes[$interval]))'
+ IPS = 'sum(irate(ceph_osd_op_w_in_bytes[1m]))',
+ OPS = 'sum(irate(ceph_osd_op_r_out_bytes[1m]))',
+ READLATENCY = 'avg(ceph_osd_apply_latency_ms)',
+ WRITELATENCY = 'avg(ceph_osd_commit_latency_ms)',
+ READCLIENTTHROUGHPUT = 'sum(irate(ceph_pool_rd_bytes[1m]))',
+ WRITECLIENTTHROUGHPUT = 'sum(irate(ceph_pool_wr_bytes[1m]))'
}