I'm using the RunCommand plugin to call a PowerShell command "Get-Service". I have a series of measures that check the running state of a series of Windows Services. My PowerShell command returns the state of the service (Running/Stopped)
The problem is that my skin absolutely hammers my CPU, occupying 100% CPU every refresh cycle, and 45% of my battery usage (PowerShell) when unplugged. Additionally, meters are not updating on the first refresh cycle. I could increase the update interval if it weren't for the fact that meter updates only occur after the second update cycle.
[Rainmeter]
Update=25000
OnUpdateAction=[!CommandMeasure measureSvc1 "Run"][!CommandMeasure measureSvc2 "Run"][!CommandMeasure measureSvc3 "Run"][!CommandMeasure measureSvc4 "Run"][!CommandMeasure measureSvc5 "Run"]
[Variables]
; Configure your solution here. Label to display in skin and the name of each Windows Service to query
Line1Label=Some Service
Line1SvcName=_SomeService1
Line2Label=Another Windows Service
Line2SvcName=_AWinSvc2
Line3Label=SQL Server
Line3SvcName=MSSQL$SQLEXPRESS
Line4Label=Something else
Line4SvcName=com.dockeing.service
Line5Label=Last thing
Line5SvcName=_InternalSystem
; Line 1
;------------------
[meterLabelLine1]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40 ; Line 1 starts at 40px, and add 20px to each subsequent line
W=190
H=14
Text=#Line1Label#
[MeterValueLine1]
Meter=String
MeasureName=measureSvc1
MeterStyle=styleRightText
X=180
Y=0r
W=190
H=14
Text=%1
[MeterIconLine1]
Meter=Image
ImageName=#@#Images\Updating.png
X=185
Y=0r
LeftMouseDoubleClickAction=[!Refresh][!Redraw]
[meterSeperator1]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=190
H=1
; (...copy paste meter 5 times incrementing variables and y values by 20px...)
Sacha00Z wrote: ↑May 2nd, 2022, 2:02 am
Is there a way of optimising my configuration?
I'm using the RunCommand plugin to call a PowerShell command "Get-Service". I have a series of measures that check the running state of a series of Windows Services. My PowerShell command returns the state of the service (Running/Stopped)
The problem is that my skin absolutely hammers my CPU, occupying 100% CPU every refresh cycle, and 45% of my battery usage (PowerShell) when unplugged.
The CPU spike is happening because you are running five RunCommand commands at the same time. There is no risk by itself running five commands simultaneously, but the spike is happening due to your commands being resource intensive.
I am not sure if you really need to run them simultaneously. If you can run them one after another, then you can do it this way:
Sacha00Z wrote: ↑May 2nd, 2022, 2:02 am
Additionally, meters are not updating on the first refresh cycle. I could increase the update interval if it weren't for the fact that meter updates only occur after the second update cycle.