1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-11 07:52:50 -05:00

correct dankgop sampling approach

This commit is contained in:
bbedward
2025-08-09 20:33:21 -04:00
parent 218eefbe19
commit 2d74753ab4
2 changed files with 8 additions and 7 deletions

View File

@@ -275,12 +275,12 @@ Singleton {
perCoreCpuUsage = cpu.coreUsage || [] perCoreCpuUsage = cpu.coreUsage || []
addToHistory(cpuHistory, cpuUsage) addToHistory(cpuHistory, cpuUsage)
// Update CPU sample data for the next run // Update CPU sample data for the next run using cursor data
if (cpu.total && cpu.cores) { if (cpu.cursor) {
cpuSampleData = { cpuSampleData = {
previousTotal: cpu.total, previousTotal: cpu.cursor.total,
previousCores: cpu.cores, previousCores: cpu.cursor.cores,
sampleTime: new Date().getTime() timestamp: cpu.cursor.timestamp
} }
} }
} }
@@ -373,11 +373,12 @@ Singleton {
proc.command.substring(0, 15) + "..." : (proc.command || "") proc.command.substring(0, 15) + "..." : (proc.command || "")
}) })
// Extract cursor data from pticks for next sampling call
if (proc.pid && typeof proc.pticks !== 'undefined') { if (proc.pid && typeof proc.pticks !== 'undefined') {
newProcSample.push({ newProcSample.push({
pid: proc.pid, pid: proc.pid,
previousTicks: proc.pticks, previousTicks: proc.pticks,
sampleTime: new Date().getTime() timestamp: new Date().getTime()
}) })
} }
} }

View File

@@ -51,7 +51,7 @@ Item {
const searchLocation = locationInput.text const searchLocation = locationInput.text
root.currentSearchText = searchLocation root.currentSearchText = searchLocation
const encodedLocation = encodeURIComponent(searchLocation) const encodedLocation = encodeURIComponent(searchLocation)
const curlCommand = `curl -s --connect-timeout 5 --max-time 10 'https://nominatim.openstreetmap.org/search?q=${encodedLocation}&format=json&limit=5&addressdetails=1'` const curlCommand = `curl -4 -s --connect-timeout 5 --max-time 10 'https://nominatim.openstreetmap.org/search?q=${encodedLocation}&format=json&limit=5&addressdetails=1'`
locationSearcher.command = ["bash", "-c", curlCommand] locationSearcher.command = ["bash", "-c", curlCommand]
locationSearcher.running = true locationSearcher.running = true
} }