It is currently March 29th, 2024, 1:24 am

[Bug? or Docs?] PingPlugin issue with DynamicVariables=1

Report bugs with the Rainmeter application and suggest features.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

[Bug? or Docs?] PingPlugin issue with DynamicVariables=1

Post by SilverAzide »

Hello,

I recently noticed one of my skins which used a PingPlugin measure was acting up and spraying thousands of debug lines into the log. I whittled the problem down to the basics below.

Part of the issue is that the skin uses a high update rate due to some animations, but does use a DefaultUpdateDivider to get most everything back to an update time of 1000ms. I had a PingPlugin measure with some conditional logic that required DynamicVariables=1 on the measure. When this happens, the plugin goes bonkers.

The following is the example code from the manual, with some minor changes. The Update and DefaultUpdateDivider settings were added/revised, along with the last 2 lines of the [MeasurePing]. Please note the measure is Disabled!

Code: Select all

[Rainmeter]
Update=20
DefaultUpdateDivider=50
BackgroundMode=2
SolidColor=0,0,0,255

[MeasurePing]
Measure=Plugin
Plugin=PingPlugin
DestAddress=www.google.com
Disabled=1
DynamicVariables=1

[MeterPing]
Meter=String
MeasureName=MeasurePing
X=5
Y=5
W=200
H=20
FontColor=255,255,255,255
Text=google.com: %1ms
If this skin is loaded (and Rainmeter is in Debug mode), it will immediately begin spraying messages into the log:

Code: Select all

PingPlugin.dll: Evaluating: www.google.com (Index: 0) (Test\Test.ini - [MeasurePing])
PingPlugin.dll: Found IPv4 address for: www.google.com (Test\Test.ini - [MeasurePing])
So, the point of this posting is to point out that the plugin measure initialization code appears to be running at 20ms intervals (due to Update=20) and doing something repeatedly (name resolution?) despite the measure being disabled, and it is because of DynamicVariables. If you comment out this line, the skin runs normally.

I'm not sure whether this is a bug in the plugin, a glitch in my test skin,... OR that the documentation may simply need to say "don't use DynamicVaribles=1 with PingPlugin". Or some combination.

Thanks!
Gadgets Wiki GitHub More Gadgets...
User avatar
Brian
Developer
Posts: 2674
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Bug? or Docs?] PingPlugin issue with DynamicVariables=1

Post by Brian »

I am not seeing an issue here. DynamicVariables=1 causes the options from any measure/meter to be read and evaluated on every Update cycle. Disabled=1 does not play role in this at all. Disabled measures only prevent the measure from actually updating (calling the measures "Update" function) and "retrieving" its value. This is not happening in your example.

https://docs.rainmeter.net/manual-beta/measures/general-options/#Disabled

Maybe the issue is just seeing the debug messages?

The ping plugin needs to validate some its options when the options are evaluated, but before the ping thread is actually ran. These "debug" messages are just there to let you know the options were validated - in this case, Rainmeter found the IP address of the "remote" server (google.com), and can properly "ping" the IP address during the Update cycle. It is basically translating the name to an address. It doesn't want to waste time doing that during the Update cycle.


Anyway, there isn't any issue here, just a debug message for validation.

-Brian
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: [Bug? or Docs?] PingPlugin issue with DynamicVariables=1

Post by SilverAzide »

Brian wrote: June 10th, 2021, 5:04 am Maybe the issue is just seeing the debug messages?
Maybe that's all it is. :) I was concerned because of the volume of messages (due to the low update rate), and also because I guess most measures that I'm familiar with don't output debug messages on every update. I just wanted to point this out in case there was an issue/concern internally with the plugin.

Thanks for looking into this! Sorry for the false alarm!
Gadgets Wiki GitHub More Gadgets...