It is currently March 28th, 2024, 7:36 pm

PerfMonPDH Performance Data Plugin

Share and get help with Plugins and Addons
rxtd
Posts: 100
Joined: April 30th, 2017, 11:51 am

Re: PerfMonPDH Performance Data Plugin

Post by rxtd »

buckb wrote:I assume you want to disable the syncing of raw and formatted counters so that your skin can more quickly begin to display valid data?
Yes.
buckb wrote:Are you referring to the Type=GetRawCounter child measure only, or do you want to get first-update data from Type=GetRawCounterSorted as well?
Both.
I would actually prefer to get all types of child measures at first update. Except those that can't be calculated (formatted & formatted sorted). It would be strange if some counters were shown but instance count was 0.

But I have already found a workaround: instant update of a parent measure in first update cycle gives me all I need. Well, except for formatted values - these are usually 0. So everything can work both ways without any modifications.

Interesting fact that NomFerp with Mode=Difference can obtain all counters of "Process" category on first update. But apparently it only works with this category. I wonder if it is a consequence of use of a different API or some specialized workaround.
It's a pity that ailia didn't open sources of his plugin.
buckb
Posts: 64
Joined: February 12th, 2018, 12:47 am

Re: PerfMonPDH Performance Data Plugin

Post by buckb »

rxtd (or anyone else following along),

I am considering the following option additions to support rollup:
  • For parent measures, RollupBy={None, InstanceName}. Specifies if, and how, to roll up parent instances. This option is not simply a boolean because some object types might benefit from other rollup mechanisms. See the performance object "GPU Engine" for possible alternative groupings.
  • For parent measures, SortRollupValue={Sum, Average, Minimum, Maximum, Count}. After rollup merges instances together, how should the rolled up instances be sorted? This option qualifies how the counter specified by SortBy and SortCounterIndex should be calculated for sorting.
  • For child measures, RollupValue={Sum, Average, Minimum, Maximum, Count}. If the parent measure's instances are being rolled up, then this option specifies how to calculate the value of the rolled up counter. Since the option is specified per child measure, a skin could declare multiple child measures referencing the same counter, but differing in the RollupValue to obtain any or all of the RollupValues for a given counter.
I am not entirely happy with the option syntax I propose. I find that the plugin's option set is becoming confusing. Specifically, SortRollupValue strikes me as complicated, but it is necessary if rollup is to permit sorting by something other than a simple sum.

I am also considering dropping the "unsorted" child measure types. They seem to become less and less useful as sorting, blacklisting/whitelisting, and now rollup features are added to the "sorted" child measure types. This would require adding an option to retrieve counters by InstanceName to the sorted child measures, just as UsageMonitor does.

Lastly, I am bumping up against UsageMonitor's functionality. This plugin was written as a learning tool and for my own use. I personally prefer to use "standard" software whenever possible. Perhaps it is time for me to do a source release and let anyone with specialized needs have at it?

Your thoughts?


--buckb
rxtd
Posts: 100
Joined: April 30th, 2017, 11:51 am

Re: PerfMonPDH Performance Data Plugin

Post by rxtd »

buckb wrote:I am considering the following option additions to support rollup
I like options that you propose. They looks perfectly logical and fit current option set well.
What can be a bit confusing is names, but I can't come up with better names.
I don't think anyone is going to use this plugin without documentation though—it already has not that simple logic behind options, so a not 100% intuitive name is not a big deal.
buckb wrote:I am also considering dropping the "unsorted" child measure types
If you speak about GetRawCounter and GetFormattedCounter then I don't see the problem if the logic of retrieving this values will be the same (I guess/hope that if no sorted child measures are specified than sorting isn't happening to reduce CPU usage). Since not many people are using this plugin so far it won't be a problem.
Child types would look clearer if there will only be GetRawCounter but not GetRawCounterSorted.
I think {GetInstanceCount, GetInstanceCountSorted} should become {GetInstanceCountUnfiltered, GetInstanceCountFiltered} because no sorting is actually used for these but black/white lists are.
Also, what is the purpose of GetInstanceNameSorted? There is a ResultString=OriginalInstanceName option so name can be obtained without it.
buckb wrote:Perhaps it is time for me to do a source release
It would be nice.
I have already had an idea that for a total flexibility it would be good to have a plugin for a plugin. Or just modify sources, yeah.
I'm not sure what can be modified though—PerfMonPDH is pretty functional as is is. Well, except for this rollup feature. But it's always better to have an ability than not to have, and there are probably people who need modifications.
buckb
Posts: 64
Joined: February 12th, 2018, 12:47 am

Re: PerfMonPDH Performance Data Plugin

Post by buckb »

rxtd wrote: I like options that you propose. They looks perfectly logical and fit current option set well.
It looks like we are in agreement regarding the additional options needed to support rollup, and elimination of the "unsorted" child measure Types. I also agree with your suggested child measure Type name changes.
rxtd wrote: Also, what is the purpose of GetInstanceNameSorted?
You are correct that ResultString=OriginalInstanceName will return instance names. However, I prefer the "symmetry" of a measure Type that returns the instance name without reference to a specific counter.


I appreciate your detailed feedback. I will have time to do the work this weekend.

--buckb
buckb
Posts: 64
Joined: February 12th, 2018, 12:47 am

Re: PerfMonPDH Performance Data Plugin

Post by buckb »

Updated plugin to version 2.0.0.0

This release contains numerous updates and changes. Skins written to PerfMonPDH 1.0.0.x will need updating to the new option syntax. Please refer to the readme in the Plugins directory for details. In summary:
  • Rollup functionality has been added. There are three new parent options (Rollup, SortRollupFunction, DisplayName) and one new child option (RollupFunction). ResultString options have changed accordingly.
  • GetInstanceCount has been renamed GetInstanceCountUnfiltered
  • GetInstanceCountSorted has been renamed GetInstanceCountFiltered
  • GetRawCounter and GetRawCounterSorted have been merged into a single GetRawCounter function
  • GetFormattedCounter and GetFormattedCounterSorted have been merged into a single GetFormattedCounter function
  • CheckInstanceValid and GetInstanceNameSorted have been merged into a single GetInstanceName function
  • SortBy=None has been added to disable sorting when not needed

--buckb
rxtd
Posts: 100
Joined: April 30th, 2017, 11:51 am

Re: PerfMonPDH Performance Data Plugin

Post by rxtd »

buckb wrote:Updated plugin to version 2.0.0.0
Thanks for the update!
New rollup functionality works great.

Obligatory mistakes and typos commentary:
In readme:
1. Line 44: ("SortCounterIndex" section) — it's probably should be added that it is ignored when "sortby=none" is set.
2. Line 283 ("PerfMon objects with a single, unnamed instance" section) — "the type of child measure" while there is no more child types.
In example skins: there are still double quotes missing. It's in all of the "MouseScrollUpAction" and "MouseScrollDownAction" options in every skin and nowhere else if I'm not mistaken.
I also have few questions:
1. RollupFunction=Index — while the rest of the rollup functions are self-explanatory I can't figure out what this one do, and I didn't find anything about it in the readme file.
2. What about opening the sources? Are you going to do it later?
I need to rollup counters in LogicalDisk category by drive letter because I have few volumes mounted as "C:\folder\diskName".
Since I don't think many people would find this useful, and since you probably don't need it, I think I will modify your plugin for this myself as soon as I have sources.
3. Do I understand correctly that now if I need to check the existence of some record then I need to compare string value of a "GetInstanceName" measure with ""?
buckb
Posts: 64
Joined: February 12th, 2018, 12:47 am

Re: PerfMonPDH Performance Data Plugin

Post by buckb »

rxtd wrote:Obligatory mistakes and typos commentary:
Fixed, although I chose not to provide additional detail on SortCounterIndex.
rxtd wrote:1. RollupFunction=Index — while the rest of the rollup functions are self-explanatory I can't figure out what this one do, and I didn't find anything about it in the readme file.
RollupFunction=Index returns the instance index for the rolled-up instance. Mostly a useless placeholder function for a counter that has no meaningful way to be rolled up.
rxtd wrote:2. What about opening the sources? Are you going to do it later?
I need to rollup counters in LogicalDisk category by drive letter because I have few volumes mounted as "C:\folder\diskName".
Since I don't think many people would find this useful, and since you probably don't need it, I think I will modify your plugin for this myself as soon as I have sources.
Source included with latest update. I'm lazy and still using VisualStudio 2015. Post your enhancements back to the thread in case someone else finds your work useful.

With the way my code works, adding a new method to roll up instances boils down to adding a new method to transform OriginalInstanceNames to RollupInstanceNames. See the following:
  • nameModificationType
  • displayNameType
  • reloadParent()
  • createModifiedNames()
  • the various modifyNameNNN() functions
rxtd wrote:3. Do I understand correctly that now if I need to check the existence of some record then I need to compare string value of a "GetInstanceName" measure with ""?
GetInstanceName has a few uses:
  • Get the instance name for a given InstanceIndex
  • Confirm the existence of a given InstanceName or InstanceIndex (1=exists, 0=does not exist)
  • Get the full instance name for a valid, though partially-specified, InstanceName (returns "Rainmeter" for "*Rain*")
--buckb
buckb
Posts: 64
Joined: February 12th, 2018, 12:47 am

Re: PerfMonPDH Performance Data Plugin

Post by buckb »

Updated plugin to version 2.0.0.1

This release includes the source code for the plugin.
Developed and compiled with VisualStudio 2015.


--buckb
rxtd
Posts: 100
Joined: April 30th, 2017, 11:51 am

Re: PerfMonPDH Performance Data Plugin

Post by rxtd »

Thanks for the sources, buckb!
And thanks for the hints how to make my modification.

I made a modified build with version 2.0.1.0. It should be in the attachment as well as modified sources. I hope you don't mind.
Changes:
For category "LogicalDisk" rollup can be performed now.
If there are mount points then instances of those points are rolled up to one instance with the name of drive letter. D:\path\mount → D:
Note that if a volume has several mount points then perfmon shows only the first one of them in the LogicalDIsk category. And if a volume has a letter assigned to it then it's always the first in the list of volume paths.

Changes in the code:
  • Added name modification enum value and its handling
  • Added name modification method for logical disks
  • I noticed that if rollup and sorting are both enabled then sorting is performed twice. I checked the code and I think that first sort doesn't change anything in this case, so I changed the conditions so that sort is not performed before rollup. For me it works as intended. Still not 100% sure that it didn't break something though.
I wrote about LogicalDisk rollup in the readme file in the attachment.
The following are not suggestions but some thoughts about what can be changed:
  • I thought that maybe GetInstanceName child measure should return instance index as number value? Well, (index + 1) since indexes in plugin starts from 0, and 0 should mean "no value". I imagine that some skin can use it for visualizing, for example, process position. I didn't change it because I don't need it, and it could break backward compatibility, but I think it can be useful.
  • Another thing that can be useful—for measures with InstanceName with partial match set use InstanceIndex for indexing matches instead of always returning first match.
I can implement it if someone needs it.
P.S. It's the first Rainmeter plugin compiled by me, so maybe I missed something.
I also don't know what should be in the "../../Version.h" file, or where I can find this file, so I just filled missing variables with what I found in the Rainmeter example plugin. I didn't change that in the attached files.
You do not have the required permissions to view the files attached to this post.
buckb
Posts: 64
Joined: February 12th, 2018, 12:47 am

Re: PerfMonPDH Performance Data Plugin

Post by buckb »

rxtd wrote:Thanks for the sources, buckb!
And thanks for the hints how to make my modification.
You are welcome, rxtd. I am glad you were able to enhance the plugin to suit your needs. Perhaps if other mods are developed and posted, I'll merge them into a single source. You should consider crediting yourself in your mod.

The two sorts in updateParent() are there in anticipation of a feature I have yet to implement. Until that feature is implemented, removing the first sort is perfectly reasonable and should not cause any problems.

I keep development and idea notes for my projects. I've added your "additional thoughts" to those notes. Thanks.


--buckb