summaryrefslogtreecommitdiffstats
path: root/Meter.h
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Header: do not let multi-column meters expand to empty neighborsChristian Göttsche2021-09-181-0/+2
| | | | | | | | | | Extending to right neighbors is intended for text meters with an overlong content, so the whole text is shown if possible. Multi column meters, like the combined memory and swap meter, position its text depending on the given total width; keep the position to the original assigned header slot. Short term resolution for #796
* Meter: update documentation to match Doxygen styleChristian Göttsche2021-08-221-1/+1
|
* Pointer indication aligned to typenameBenny Baumann2021-07-151-1/+1
|
* Pretty-print values in the PCP DynamicMeter codeNathan Scott2021-07-081-0/+4
| | | | | | | | | | | | | | | | | Several improvements to the way values are displayed in the PCP platform DynamicMeter implementation: - handle the initial 'caption' setting as with regular meters, this required a new meter callback because we no longer have just a single meter caption for the DynamicMeter case - if no label is provided for a metric in a configuration file use the short form metric name as a fallback - honour the suffix setting in the configuration file - convert metric values to the canonical units for htop (kbyte and seconds), and use Meter_humanUnit when it makes sense to do so. Also improves the handling of fatal string error messages in a couple of places, thanks to BenBE for the review feedback.
* Add a new DynamicMeter class for runtime Meter extensionNathan Scott2021-07-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is based on exploratory work by Sohaib Mohamed. The end goal is two-fold - to support addition of Meters we build via configuration files for both the PCP platform and for scripts ( https://github.com/htop-dev/htop/issues/526 ) Here, we focus on generic code and the PCP support. A new class DynamicMeter is introduced - it uses the special case 'param' field handling that previously was used only by the CPUMeter, such that every runtime-configured Meter is given a unique identifier. Unlike with the CPUMeter this is used internally only. When reading/writing to htoprc instead of CPU(N) - where N is an integer param (CPU number) - we use the string name for each meter. For example, if we have a configuration for a DynamicMeter for some Redis metrics, we might read and write "Dynamic(redis)". This identifier is subsequently matched (back) up to the configuration file so we're able to re-create arbitrary user configurations. The PCP platform configuration file format is fairly simple. We expand configs from several directories, including the users homedir alongside htoprc (below htop/meters/) and also /etc/pcp/htop/meters. The format will be described via a new pcp-htop(5) man page, but its basically ini-style and each Meter has one or more metric expressions associated, as well as specifications for labels, color and so on via a dot separated notation for individual metrics within the Meter. A few initial sample configuration files are provided below ./pcp/meters that give the general idea. The PCP "derived" metric specification - see pmRegisterDerived(3) - is used as the syntax for specifying metrics in PCP DynamicMeters.
* cleaned up includes with iwyumayurdahibhate2021-05-101-0/+1
|
* Use unsigned types for CPU counts and associated variablesChristian Göttsche2021-03-191-2/+2
|
* Save text buffer in MeterChristian Göttsche2021-03-041-5/+6
|
* Allow meters in text mode to span empty neighbors to the rightChristian Göttsche2021-01-231-0/+1
| | | | Closes: #484
* Mark several non-modified pointer variables constChristian Göttsche2021-01-111-1/+1
|
* LoadMeter: dynamically adjust color and total of barChristian Göttsche2020-12-261-0/+1
| | | | | | | | | | Change the color and total based on the actual 1min load value: < 1 : green and total of 1.0 < cpu-count : yellow and total of cpu-count else : red and total of 2*cpu-count Closes: #32
* Introduce METER_BUFFER_CHECK and METER_BUFFER_APPEND_CHR to cleanup writing ↵Christian Göttsche2020-12-061-0/+23
| | | | | | to bar buffers Closes: #294
* Use size_t as len type for Meter_UpdateValuesChristian Göttsche2020-12-061-2/+2
| | | | Most of the time the parameter is passed to snprintf type functions
* Meter: document MeterClass string fieldsChristian Göttsche2020-12-021-4/+4
|
* IWYU update (Linux)Christian Göttsche2020-11-191-0/+1
|
* Use integer type for item count instead of charChristian Göttsche2020-10-311-2/+2
|
* Hold only a const version of the ProcessList in MetersChristian Göttsche2020-10-261-2/+2
|
* XUtils string related updatesChristian Göttsche2020-10-191-0/+2
| | | | | | | | | | - allow count out-parameter of String_split() to be NULL - introduce xStrndup() - do not allow NULL pointers passed to String_eq() it is not used in any code - implement String_startsWith(), String_contains_i() and String_eq() as inline header functions - adjust several conversion issues
* Make all required includes explicitBenny Baumann2020-10-181-2/+7
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* CPUMeter: avoid crashes and leaks in case the CPU count changesChristian Göttsche2020-10-121-0/+1
| | | | | | | E.g. if the HT/SMT mode changes Use separate data for sub-meters Do not reuse drawData for maintainability
* Meter: use explicit type for drawDataChristian Göttsche2020-10-121-6/+6
|
* Mark Object instances constChristian Göttsche2020-10-071-3/+3
|
* Mark Object classes and Object class fields constChristian Göttsche2020-10-071-11/+9
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Sort headers/includesBenny Baumann2020-09-291-1/+2
|
* Covert Meter attributes to file-local constant arraysChristian Göttsche2020-09-291-2/+0
|
* Clean up some code duplication in the header filesHugo Musso Gualandi2020-09-121-23/+2
| | | | | | | | | | | | | PR htop-dev/htop#70 got rid of the infrastructure for generating header files, but it left behind some code duplication. Some of cases are things that belong in the header file and don't need to be repeated in the C file. Other cases are things that belong in the C file and don't need to be in the header file. In this commit I tried to fix all of these that I could find. When given a choice I preferred keeping things out of the header file, unless they were being used by someone else.
* Consolidate repeated macro definitions into one headerNathan Scott2020-09-091-10/+0
| | | | | | | | The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear throughout the codebase with many re-definitions. Make a single copy of each in a common header file, and use the BSD variants of MINIMUM/MAXIMUM due to conflicts in the system <sys/param.h> headers.
* Further, minor cleanups to headers post-MakeHeadersNathan Scott2020-09-081-6/+0
| | | | | Remove leftover empty ifdef/endif pairs, whitespace. The generated htop.h file was also unused - removed.
* Remove superfluous 'extern's from function declarations.Zev Weiss2020-09-031-6/+6
| | | | | | | | Applied via: $ find * -name '*.h' -exec sed -i -r 's/^extern (.+\()/\1/;' {} + Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com>
* Axe automated header generation.Zev Weiss2020-09-031-2/+0
| | | | | | | | | | | | | | Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
* Merge branch 'hishamhm-pull-960'Nathan Scott2020-08-201-1/+1
|\
| * Clean up existing whitespaceDaniel Flanagan2019-10-311-1/+1
| |
* | Re-generate all headers with latest scripts/MakeHeader.pyNathan Scott2020-08-181-6/+6
|/ | | | Sync-up missing extern declarations for many functions.
* Rename Meter.setValues() functions to updateValues()Explorer092016-05-041-3/+4
| | | | | | | | | | | | Rationale (copied from htop issue #471): The function name "setValues" is misleading. For most OOP (object- oriented programming) contexts, setXXX functions mean they will change some member variables of an object into something specified in function arguments. But in the *Meter_setValues() case, the new values are not from the arguments, but from a hard-coded source. The caller is not supposed to change the values[] to anything it likes, but rather to "update" the values from the source. Hence, updateValues is a better name for this family of functions.
* New macro GRAPH_HEIGHT for Graph Meter heightExplorer092016-01-211-0/+2
| | | | | | | | (Cherry-picked from e93028d7fa0c5f00b5dc3336fd28abaf905cd572, the experimental graph coloring branch) Currently GRAPH_HEIGHT=4 . This prevents hard-coding the height of the graph meters, and allows user to change it at compile-time.
* Introduce CLAMP macro. Unify all MIN(MAX(a,b),c) uses.Explorer092016-01-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | With the CLAMP macro replacing the combination of MIN and MAX, we will have at least two advantages: 1. It's more obvious semantically. 2. There are no more mixes of confusing uses like MIN(MAX(a,b),c) and MAX(MIN(a,b),c) and MIN(a,MAX(b,c)) appearing everywhere. We unify the 'clamping' with a single macro. Note that the behavior of this CLAMP macro is different from the combination `MAX(low,MIN(x,high))`. * This CLAMP macro expands to two comparisons instead of three from MAX and MIN combination. In theory, this makes the code slightly smaller, in case that (low) or (high) or both are computed at runtime, so that compilers cannot optimize them. (The third comparison will matter if (low)>(high); see below.) * CLAMP has a side effect, that if (low)>(high) it will produce weird results. Unlike MIN & MAX which will force either (low) or (high) to win. No assertion of ((low)<=(high)) is done in this macro, for now. This CLAMP macro is implemented like described in glib <http://developer.gnome.org/glib/stable/glib-Standard-Macros.html> and does not handle weird uses like CLAMP(a++, low++, high--) .
* make units more dynamicChristian Hesse2015-08-271-0/+2
| | | | Signed-off-by: Christian Hesse <mail@eworm.de>
* remove UTF-8 code when compiling with --disable-unicodeChristian Hesse2015-08-191-0/+8
|
* make arrays one dimensionalChristian Hesse2015-08-191-0/+3
| | | | | | With more dimensional arrays we have to define the array size. Use one dimensional arrays to be more flexible. Additionally this allows to shrink array size for ASCII.
* Fix saving of header states, motion in Setup screen.Hisham Muhammad2015-03-161-1/+1
|
* Add longer descriptions to available meters.Hisham Muhammad2015-02-031-0/+1
|
* Another mega-patch for the refactoring process.Hisham Muhammad2015-01-231-0/+2
| | | | | Kinda runs, but functionality from the original main loop is still missing. Patience.
* Sorry about the mega-patch.Hisham Muhammad2015-01-211-6/+5
| | | | | This is a work-in-progress, code is currently broken. (Some actions, and notably, the header, are missing.)
* Move UptimeMeter into platform-dependent area.Hisham Muhammad2014-11-271-2/+0
| | | | Set up environment to move other meters.
* alignment improvementsHisham Muhammad2014-02-271-0/+6
|
* BUGFIX: Fix crash when adding meters and toggling detailed CPU time.Hisham Muhammad2014-01-161-3/+4
| | | | | See https://bugzilla.redhat.com/show_bug.cgi?id=987805 for details. (thanks to Dawid Gajownik for the detailed analysis!)
* Changes in object model: separate class objects to store vtable. Also, nicer ↵Hisham Muhammad2012-12-051-51/+45
| | | | UTF-8 display of big numbers.
* major header cleanupHisham Muhammad2011-12-261-27/+2
|

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