🚑️ Fix method not found
This commit is contained in:
parent
855e48f6b2
commit
a417cb9238
@ -33,7 +33,7 @@ public class MemoryMonitoringJobRunner
|
||||
{
|
||||
String podId = pod.getMetadata().getUid();
|
||||
String podName = pod.getMetadata().getName();
|
||||
String result = processRunner.run(String.format("kubectl top pod %s -n %s", podName, config.getTargetConfig().getNamespace()));
|
||||
String result = processRunner.runToText(String.format("kubectl top pod %s -n %s", podName, config.getTargetConfig().getNamespace()));
|
||||
indexingService.index(String.format("POD-%s", podId), MonitoringType.MEMORY.toString(), Map.ofEntries(Map.entry("CPU", ByteExtractor.extractBytes(result))));
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ public class VolumeMonitoringJobRunner
|
||||
String podName = pod.getMetadata().getName();
|
||||
if (pod.getStatus().getPhase().equals("Running"))
|
||||
{
|
||||
String result = processRunner.run(String.format("kubectl exec -i %s -c %s -n %s -- df -B1 --output=size,used,avail,pcent -h %s -B1", podName, monitoring.getVolumeConfig().getContainerName(), monitoring.getTargetConfig().getNamespace(), monitoring.getVolumeConfig().getMountPath()));
|
||||
String result = processRunner.runToText(String.format("kubectl exec -i %s -c %s -n %s -- df -B1 --output=size,used,avail,pcent -h %s -B1", podName, monitoring.getVolumeConfig().getContainerName(), monitoring.getTargetConfig().getNamespace(), monitoring.getVolumeConfig().getMountPath()));
|
||||
UsageMetrics usage = extractUsage(result);
|
||||
volumeUsageRepo.persist(new VolumeUsage(UUID.randomUUID().toString(), monitoring.getId(), podId, podName, monitoring.getTargetConfig().getNamespace(), ZonedDateTime.now().truncatedTo(ChronoUnit.MILLIS), usage));
|
||||
indexingService.index(String.format("POD-%s", podId), MonitoringType.VOLUME.toString(), Map.ofEntries(Map.entry("VOLUME", (long) usage.percentage())));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user