+
Metrics
Basic metrics for your container.
- @if ($resource->getMorphClass() === 'App\Models\Application' && $resource->build_pack === 'dockercompose')
-
Metrics are not available for Docker Compose applications yet!
- @elseif(!$resource->destination->server->isMetricsEnabled())
-
Metrics are only available for servers with Sentinel & Metrics enabled!
-
- @else
- @if (!str($resource->status)->contains('running'))
-
Metrics are only available when this resource is running!
+
+ @if ($resource->getMorphClass() === 'App\Models\Application' && $resource->build_pack === 'dockercompose')
+
Metrics are not available for Docker Compose applications yet!
+ @elseif(!$resource->destination->server->isMetricsEnabled())
+
Metrics are only available for servers with Sentinel & Metrics enabled!
+
@else
-
+ @if (!str($resource->status)->contains('running'))
+ Metrics are only available when this resource is running!
+ @else
+
+
@@ -77,63 +76,76 @@
xaxis: {
type: 'datetime',
},
- series: [{
- name: "CPU %",
- data: []
- }],
- noData: {
- text: 'Loading...',
- style: {
- color: textColor,
- }
- },
- tooltip: {
- enabled: true,
- marker: {
- show: false,
- }
- },
- legend: {
- show: false
- }
+ series: [{
+ name: "CPU %",
+ data: []
+ }],
+ noData: {
+ text: 'Loading...',
+ style: {
+ color: textColor,
+ }
+ },
+ tooltip: {
+ enabled: true,
+ marker: {
+ show: false,
+ },
+ custom: function({ series, seriesIndex, dataPointIndex, w }) {
+ const value = series[seriesIndex][dataPointIndex];
+ const timestamp = w.globals.seriesX[seriesIndex][dataPointIndex];
+ const date = new Date(timestamp);
+ const timeString = String(date.getUTCHours()).padStart(2, '0') + ':' +
+ String(date.getUTCMinutes()).padStart(2, '0') + ':' +
+ String(date.getUTCSeconds()).padStart(2, '0') + ', ' +
+ date.getUTCFullYear() + '-' +
+ String(date.getUTCMonth() + 1).padStart(2, '0') + '-' +
+ String(date.getUTCDate()).padStart(2, '0');
+ return '';
+ }
+ },
+ legend: {
+ show: false
+ }
}
- const serverCpuChart = new ApexCharts(document.getElementById(`{!! $chartId !!}-cpu`), optionsServerCpu);
- serverCpuChart.render();
- document.addEventListener('livewire:init', () => {
- Livewire.on('refreshChartData-{!! $chartId !!}-cpu', (chartData) => {
- checkTheme();
- serverCpuChart.updateOptions({
- series: [{
- data: chartData[0].seriesData,
- }],
- colors: [cpuColor],
- xaxis: {
- type: 'datetime',
- labels: {
- show: true,
- style: {
- colors: textColor,
- }
- }
- },
- yaxis: {
- show: true,
- labels: {
- show: true,
- style: {
- colors: textColor,
- }
- }
- },
- noData: {
- text: 'Loading...',
- style: {
- color: textColor,
- }
- }
- });
- });
- });
+ const serverCpuChart = new ApexCharts(document.getElementById(`{!! $chartId !!}-cpu`), optionsServerCpu);
+ serverCpuChart.render();
+ Livewire.on('refreshChartData-{!! $chartId !!}-cpu', (chartData) => {
+ checkTheme();
+ serverCpuChart.updateOptions({
+ series: [{
+ data: chartData[0].seriesData,
+ }],
+ colors: [cpuColor],
+ xaxis: {
+ type: 'datetime',
+ labels: {
+ show: true,
+ style: {
+ colors: textColor,
+ }
+ }
+ },
+ yaxis: {
+ show: true,
+ labels: {
+ show: true,
+ style: {
+ colors: textColor,
+ }
+ }
+ },
+ noData: {
+ text: 'Loading...',
+ style: {
+ color: textColor,
+ }
+ }
+ });
+ });
Memory (MB)
@@ -195,65 +207,80 @@
},
series: [{
name: "Memory (MB)",
- data: []
- }],
- noData: {
- text: 'Loading...',
- style: {
- color: textColor,
- }
- },
- tooltip: {
- enabled: true,
- marker: {
- show: false,
- }
- },
- legend: {
- show: false
- }
+ data: []
+ }],
+ noData: {
+ text: 'Loading...',
+ style: {
+ color: textColor,
+ }
+ },
+ tooltip: {
+ enabled: true,
+ marker: {
+ show: false,
+ },
+ custom: function({ series, seriesIndex, dataPointIndex, w }) {
+ const value = series[seriesIndex][dataPointIndex];
+ const timestamp = w.globals.seriesX[seriesIndex][dataPointIndex];
+ const date = new Date(timestamp);
+ const timeString = String(date.getUTCHours()).padStart(2, '0') + ':' +
+ String(date.getUTCMinutes()).padStart(2, '0') + ':' +
+ String(date.getUTCSeconds()).padStart(2, '0') + ', ' +
+ date.getUTCFullYear() + '-' +
+ String(date.getUTCMonth() + 1).padStart(2, '0') + '-' +
+ String(date.getUTCDate()).padStart(2, '0');
+ return '';
+ }
+ },
+ legend: {
+ show: false
+ }
}
- const serverMemoryChart = new ApexCharts(document.getElementById(`{!! $chartId !!}-memory`),
- optionsServerMemory);
- serverMemoryChart.render();
- document.addEventListener('livewire:init', () => {
- Livewire.on('refreshChartData-{!! $chartId !!}-memory', (chartData) => {
- checkTheme();
- serverMemoryChart.updateOptions({
- series: [{
- data: chartData[0].seriesData,
- }],
- colors: [ramColor],
- xaxis: {
- type: 'datetime',
- labels: {
- show: true,
- style: {
- colors: textColor,
- }
- }
- },
- yaxis: {
- min: 0,
- show: true,
- labels: {
- show: true,
- style: {
- colors: textColor,
- }
- }
- },
- noData: {
- text: 'Loading...',
- style: {
- color: textColor,
- }
- }
- });
- });
- });
+ const serverMemoryChart = new ApexCharts(document.getElementById(`{!! $chartId !!}-memory`),
+ optionsServerMemory);
+ serverMemoryChart.render();
+ Livewire.on('refreshChartData-{!! $chartId !!}-memory', (chartData) => {
+ checkTheme();
+ serverMemoryChart.updateOptions({
+ series: [{
+ data: chartData[0].seriesData,
+ }],
+ colors: [ramColor],
+ xaxis: {
+ type: 'datetime',
+ labels: {
+ show: true,
+ style: {
+ colors: textColor,
+ }
+ }
+ },
+ yaxis: {
+ min: 0,
+ show: true,
+ labels: {
+ show: true,
+ style: {
+ colors: textColor,
+ }
+ }
+ },
+ noData: {
+ text: 'Loading...',
+ style: {
+ color: textColor,
+ }
+ }
+ });
+ });
+
@endif
@endif
+