summaryrefslogtreecommitdiffstats
path: root/DiskIOMeter.c
Commit message (Collapse)AuthorAgeFilesLines
* Update includes based on IWYUBenny Baumann2023-12-261-3/+2
|
* Fix code styleBenny Baumann2023-12-261-13/+12
|
* Add includes for config.h as per the discussion in PR #1337Daniel Lange2023-12-261-0/+2
| | | | | | Many thanks to @Explorer09 Kang-Che Sung (宋岡哲). Also add a #error stanza to XUtils.h in case somebody forgets the beautiful mess GNU forces on us.
* DiskIOMeter: Cache the formatted "KiB/s" number stringsExplorer092023-11-241-14/+9
| | | | | | | | In DiskIOMeter, the number strings of bytes per second are formatted with Meter_humanUnit(). As the numbers are only updated every 500 ms, it is good to cache the formatted strings. This saves code size. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Always update 'values' member of DiskIOMeterExplorer092023-11-241-37/+44
| | | | | | | | | | | Always update the `values` member during the call of DiskIOMeter_updateValues(). This makes the values of every instance of DiskIOMeter consistent. The user might see non-zero bars (or graph) during the "stale" status of the meter after this commit. The side effect is not a bug. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Use xSnprintf in DiskIOMeter_updateValues()Explorer092023-11-241-1/+1
|
* Cap DiskIOMeter "utilisation" percentage at 100%Explorer092023-11-241-1/+1
| | | | | | | When `cached_utilisation_diff` is capped, it would never be greater than `DiskIOMeter.total`. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Rename ProcessList to ProcessTable throughoutNathan Scott2023-08-311-1/+1
| | | | | | | | | | | | Following up with some discusson from a few months back, where it was proposed that ProcessTable is a better name. This data structure is definitely not a list ... if it was one-dimensional it'd be a set, but in practice it has much more in common with a two-dimensional table. The Process table is a familiar operating system concept for many people too so it resonates a little in that way as well.
* Introduce Machine class for host-specific info (split from ProcessList)Nathan Scott2023-05-081-3/+3
| | | | | | | | | | | First stage in sanitizing the process list structure so that htop can support other types of lists too (cgroups, filesystems, ...), in the not-too-distant future. This introduces struct Machine for system-wide information while keeping process-list information in ProcessList (now much less). Next step is to propogate this separation into each platform, to match these core changes.
* DiskIOMeter: indicate read and write in meter modeChristian Hesse2022-12-061-1/+1
| | | | ... as this can not be distinguished currently.
* DiskIOMeter: use complete unitsChristian Hesse2022-12-061-1/+3
| | | | | | There were missing "iB/s" before. Fixes #1126
* DiskIOMeter: convert to bytes per secondChristian Hesse2022-12-061-0/+2
| | | | ... do not show values per interval (which is 1.5 seconds by default).
* DiskIOMeter: use define ONE_KChristian Hesse2022-12-061-2/+2
| | | | ... instead of numerical value. It is defined in Process.h.
* IOMeters: rework initial displayChristian Göttsche2021-12-081-12/+32
| | | | | | | | | Show a non highlighted string at the start of htop, not the failure text. Also the original fix only handled the text mode, not the bar mode. Improves: 2977414d ("Discard stale information from DiskIO and NetworkIO meters") Related: #860
* Discard stale information from DiskIO and NetworkIO metersBenny Baumann2021-10-301-0/+6
| | | | | | | This ensures the initial read of the data is not misinterpreted as arbitrarily large values. Also this forces the maximum update interval between two subsequent reads to within 30s. Fixes #860
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* cleaned up includes with iwyumayurdahibhate2021-05-101-1/+1
|
* Use RichString_appendnAscii where possibleChristian Göttsche2021-04-261-2/+3
| | | | | | | | | | `RichString_appendnAscii()` avoids a `strlen(3)` call over ` RichString_appendAscii()`. Use the former where the length is available from a previous checked `snprintf(3)` call. Keep `RichString_appendAscii()` when passing a string literal and rely on compilers to optimize the `strlen(3)` call away.
* Request the realtime and monotonic clock times once per sampleNathan Scott2021-04-051-2/+2
| | | | | | | | | | | | | | | | Refactor the sample time code to make one call to gettimeofday (aka the realtime clock in clock_gettime, when available) and one to the monotonic clock. Stores each in more appropriately named ProcessList fields for ready access when needed. Every platform gets the opportunity to provide their own clock code, and the existing Mac OS X specific code is moved below darwin instead of in Compat. A couple of leftover time(2) calls are converted to use these ProcessList fields as well, instead of yet again sampling the system clock. Related to https://github.com/htop-dev/htop/pull/574
* Merging all the points related to calculating time in one placeSohaib2021-04-051-6/+4
| | | | | | | | | | | | | | The end goal is to consolidate all the points in htop that can only work in live-only mode today, so that will be able to inject PCP archive mode and have a chance at it working. The biggest problem we've got at this moment is all the places that are independently asking the kernel to 'give me the time right now'. Each of those needs to be audited and ultimately changed to allow platforms to manage their own idea of time. So, all the calls to gettimeofday(2) and time(2) are potential problems. Ultimately I want to get these down to just one or two. Related to https://github.com/htop-dev/htop/pull/574
* Save text buffer in MeterChristian Göttsche2021-03-041-3/+3
|
* Switch DiskIO Meter to using uint32_t and uint64_tNathan Scott2021-03-021-13/+13
| | | | From review via @BenBE, this is now a whole lot cleaner.
* Fix integer sizing issues in the DiskIO MeterNathan Scott2021-03-011-12/+18
| | | | | | | | | On Linux kernels the size of the values exported for block device bytes has used a 64 bit integer for quite some time (2.6+ IIRC). Make the procfs value extraction use correct types and change internal types used to rate convert these counters (within the DiskIO Meter) 64 bit integers, where appropriate.
* De-typo DiskIOMeterDaniel Lange2021-02-151-2/+2
|
* Split RichString_(append|appendn|write) into wide and asciiChristian Göttsche2020-12-081-6/+6
| | | | | | | | RichString_writeFrom takes a top spot during performance analysis due to the calls to mbstowcs() and iswprint(). Most of the time we know in advance that we are only going to print regular ASCII characters.
* Use size_t as len type for Meter_UpdateValuesChristian Göttsche2020-12-061-1/+1
| | | | Most of the time the parameter is passed to snprintf type functions
* Convert personal copyright authorship to teamChristian Göttsche2020-12-041-1/+1
|
* Reduce scope of cached valuesBenny Baumann2020-11-221-3/+4
|
* IWYU update (Linux)Christian Göttsche2020-11-191-0/+1
|
* Handle data wraparounds in IO MetersChristian Göttsche2020-11-021-4/+15
| | | | | | | If the current data is smaller than the previous one, either by a retrieve error or a device removal or a original data wraparound, sanitize the value to zero. Fixes: #299
* FreeBSD: implement Platform_getDiskIO()Christian Goettsche2020-10-291-8/+9
|
* Improve handling of no data in Disk and Network IO MetersChristian Göttsche2020-10-261-4/+17
|
* Make all required includes explicitBenny Baumann2020-10-181-1/+5
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* Rename StringUtils.[ch] to XUtils.[ch]Benny Baumann2020-10-161-1/+1
|
* Move xAsprintf, xSnprintf and xStrdup to StringUtils.hBenny Baumann2020-10-161-0/+1
|
* Generalize Meter value colors for IOChristian Göttsche2020-10-161-6/+6
|
* Mark Object pointer to _display function constChristian Göttsche2020-10-101-1/+1
|
* Mark Object instances constChristian Göttsche2020-10-071-1/+1
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Add DiskIOMeter for IO read/write usageChristian Göttsche2020-10-031-0/+92

© 2014-2024 Faster IT GmbH | imprint | privacy policy