It is currently May 25th, 2019, 10:08 am

New UsageMonitor plugin

Changes made during the Rainmeter 4.2 beta cycle.
User avatar
tjhrulz
Developer
Posts: 225
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: New UsageMonitor plugin

tjhrulz » November 21st, 2018, 5:13 am

rxtd wrote:
November 18th, 2018, 9:51 pm
Youkai1977, UsageMonitor has different number and string values. Most of the other measures have same number and string values, or only have meaningful string value.
When you use old PerfMon plugin in the place where a string value is expected, you will get numbers. Because string value of the PerfMon plugin is the same, as its number value.
When you use UsageMonitor plugin in the place where a string value is expected, you will its string value, which is the name of the instance.
In case of String meter you need to do something to make it show number value. For example:
1) Use Calc measure which will extract number value from UsageMonitor, and set its value to this number. Calc measures have same number and string values.
2) Use [DiskAccess_C_R:] form of the access to a measure, with DynamicVariables enabled. Notice the colon: [DiskAccess_C_R:].
Not all measures/meters will access string value of a measure. Calc measure, as you already know, uses number value. Bar, Line, and some other meters/measures will also get number value. So you don't need to always use Calc. You only need it if you don't want to use dynamic variables or want to pass number value of UsageMonitor to a place, where string value is used (like in MeasureName=somemeasure in String meter).
Someone got it, Thank you!

Yeah the way UsageMonitor works was very intentional. Mind you to get the String and Number value before you would have had to have done two measures and the second measure was just as expensive as the first (With the exception of NomFerp which if you used parent children the it would be slightly less expensive). The only reason you need a calc is if you do any manipulation to the number (Such as rounding or trimming it). When I was building the plugin I talked with jsmorley about adding the ability for scaling for inline measure's number access and we agreed that was a bad idea.
rxtd
Posts: 95
Joined: April 30th, 2017, 11:51 am

Re: New UsageMonitor plugin

rxtd » November 21st, 2018, 5:38 am

tjhrulz wrote:
November 21st, 2018, 5:13 am
Mind you to get the String and Number value before you would have had to have done two measures and the second measure was just as expensive as the first (With the exception of NomFerp which if you used parent children the it would be slightly less expensive).
Actually, I think that with parent/child approach declaring one more child measure is pretty cheap. It's not "slightly less expensive", it's roughly as declaring empty measure. Especially cheap when using index to get value, but accessed names of the instances can be cached, so they are cheap too.
And result string value could be controlled with an option, just as it's done in PerfMonPHD and PerfMonRxtd plugins.
User avatar
tjhrulz
Developer
Posts: 225
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: New UsageMonitor plugin

tjhrulz » November 21st, 2018, 6:35 am

rxtd wrote:
November 21st, 2018, 5:38 am
Actually, I think that with parent/child approach declaring one more child measure is pretty cheap. It's not "slightly less expensive", it's roughly as declaring empty measure. Especially cheap when using index to get value, but accessed names of the instances can be cached, so they are cheap too.
And result string value could be controlled with an option, just as it's done in PerfMonPHD and PerfMonRxtd plugins.
I was refering to NomFerp specifically in that regard, although slightly is understating it as going from a 300ms hit to a 15ms hit is a big one. But that is still 14ms+ more than UsageMonitor.
User avatar
Youkai1977
Posts: 16
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: New UsageMonitor plugin

Youkai1977 » November 25th, 2018, 12:06 am

@rxtd and the others:

Sorry that I have not responded to your response from 18 September. At the moment I'm pretty busy in my family. Anyway, I'm still looking at the thing with the UsageMonitor and rewrite my meters accordingly. However, the thing about translating me makes a lot of problems. The Google Translator is not always very helpful ... there are sometimes sentences around, because then I understand nothing more. Say I need time. The thing that helps me best is code snippets or code examples. Why then what is as it is, is rather secondary to me. It should only work ...
User avatar
balala
Rainmeter Sage
Posts: 8207
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: New UsageMonitor plugin

balala » November 25th, 2018, 2:23 pm

Youkai1977 wrote:
November 25th, 2018, 12:06 am
Sorry that I have not responded to your response from 18 September.
Sorry, 18 November, not September, to be precise.
I'm not sure, do you have any further question?
User avatar
Youkai1977
Posts: 16
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: New UsageMonitor plugin

Youkai1977 » November 26th, 2018, 7:13 am

balala wrote:
November 25th, 2018, 2:23 pm
Sorry, 18 November, not September, to be precise.
No commend :o :oops:
I'm not sure, do you have any further question?
To UsageMonitor ... I do not know currently. If I do not even remember what month we have :oops: :rofl:

On the subject of Rainmeter in general I will certainly have many more questions in the future
User avatar
balala
Rainmeter Sage
Posts: 8207
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: New UsageMonitor plugin

balala » November 26th, 2018, 1:59 pm

Youkai1977 wrote:
November 26th, 2018, 7:13 am
On the subject of Rainmeter in general I will certainly have many more questions in the future
Ok, when you have any, just feel free to open a new topic.
User avatar
cwfrizzell
Posts: 76
Joined: August 10th, 2009, 9:03 pm

Re: New UsageMonitor plugin

cwfrizzell » December 9th, 2018, 5:19 am

How does one measure running processes, both total and user?
Cheers!

Chuck
Yincognito
Posts: 652
Joined: February 27th, 2015, 2:38 pm

Re: New UsageMonitor plugin

Yincognito » December 16th, 2018, 10:41 pm

Win10x64 (v.1803)
Rainmeter 4.3.0.3266b x64 (deleted the NomFerp plugin, let only UsageMonitor, as recommended by jsmorley)

Is it normal for processes to "dissapear" (i.e. not have a process name) in both the visual Rainmeter log and my skin, when the numerical value of the counter is 0? I ask it because it happened to me in both this Rainmeter version and in the 4.3.0.3260 x64 one (much more often in the latter though). My code is something like this (simplified version - disregard the odd or specific stuff in the code, it's just displaying the top 5 CPU processes in the tooltip, basically):

Code: Select all

[MS_UsageMonitor_CPUProcess1]
Group=CPUProcessesGroup
Measure=Plugin
Plugin=UsageMonitor
Alias=#ProcessAlias1#
Index=1

[MS_UsageMonitor_CPUProcess2]
Group=CPUProcessesGroup
Measure=Plugin
Plugin=UsageMonitor
Alias=#ProcessAlias1#
Index=2

[MS_UsageMonitor_CPUProcess3]
Group=CPUProcessesGroup
Measure=Plugin
Plugin=UsageMonitor
Alias=#ProcessAlias1#
Index=3

[MS_UsageMonitor_CPUProcess4]
Group=CPUProcessesGroup
Measure=Plugin
Plugin=UsageMonitor
Alias=#ProcessAlias1#
Index=4

[MS_UsageMonitor_CPUProcess5]
Group=CPUProcessesGroup
Measure=Plugin
Plugin=UsageMonitor
Alias=#ProcessAlias1#
Index=5

[MT_UsageMonitor_CPUProcesses]
Group=CPUProcessesGroup
Hidden=1
Meter=STRING
MeterStyle=STitleColText
Text="CPU.P"
ToolTipTitle="Top CPU Processes"
ToolTipText="[MS_UsageMonitor_CPUProcess1:2]%  [MS_UsageMonitor_CPUProcess1]#CRLF#[MS_UsageMonitor_CPUProcess2:2]%  [MS_UsageMonitor_CPUProcess2]#CRLF#[MS_UsageMonitor_CPUProcess3:2]%  [MS_UsageMonitor_CPUProcess3]#CRLF#[MS_UsageMonitor_CPUProcess4:2]%  [MS_UsageMonitor_CPUProcess4]#CRLF#[MS_UsageMonitor_CPUProcess5:2]%  [MS_UsageMonitor_CPUProcess5]"
MouseScrollUpAction=[!UnpauseMeasure MS_Rainmeter_Counter][!SetOption MS_Rainmeter_Counter Formula (#ProcessCycleDuration#*Trunc(((MS_Rainmeter_Counter+(4-2)*#ProcessCycleDuration#)%(#ProcessCycleDuration#*4))/#ProcessCycleDuration#)+1)][!UpdateMeasure *][!UpdateMeter *][!Redraw][!SetOption MS_Rainmeter_Counter Formula (MS_Rainmeter_Counter%(#ProcessCycleDuration#*4))+#CounterIncrementStep#]
MouseScrollDownAction=[!UnpauseMeasure MS_Rainmeter_Counter][!SetOption MS_Rainmeter_Counter Formula (#ProcessCycleDuration#*Trunc((MS_Rainmeter_Counter%(#ProcessCycleDuration#*4))/#ProcessCycleDuration#)+1)][!UpdateMeasure *][!UpdateMeter *][!Redraw][!SetOption MS_Rainmeter_Counter Formula (MS_Rainmeter_Counter%(#ProcessCycleDuration#*4))+#CounterIncrementStep#]
LeftMouseUpAction=[taskmgr.exe]
RightMouseUpAction=[!TogglePauseMeasure MS_Rainmeter_Counter]
DynamicVariables=1

[MT_UsageMonitor_CPUProcessValue1]
Group=CPUProcessesGroup
Hidden=1
Meter=STRING
MeterStyle=SPrimaryColText
Text="[MS_UsageMonitor_CPUProcess1:2] %"
DynamicVariables=1

[MT_UsageMonitor_CPUProcessName1]
Group=CPUProcessesGroup
Hidden=1
Meter=STRING
MeterStyle=SSecondaryTertiaryColText
MeasureName=MS_UsageMonitor_CPUProcess1
Text="%1"

Screenshot:
Rainmeter UsageMonitor 00.jpg
Note: If it matters, aside from the "standard" plugins included with Rainmeter (e.g. PerfMon plugin present, but skins using it unloaded), I use the MSIAfterburner 2.0.0.0 plugin. I even unloaded all the skins and left only this one, and the "dissapearing" behavior still happens...
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 19245
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New UsageMonitor plugin

jsmorley » December 16th, 2018, 10:52 pm

https://docs.rainmeter.net/manual-beta/plugins/usagemonitor/#Index
Note: Any Index which returns a current value of 0 will return an empty string as the string value. An instance without a value can't be sorted, and can't exist in this indexed list, as it is indistinguishable from all other instances that are 0.