Not knowing Chinese made things a bit hard but I figured it out

At least how to show a histogram (aka chart) of disk activity.
Put a new timer core into your widget and set it to update every sec. Then a chart control. The JS code will query WMI to get the disk activity and add the value to the chart. In my case it's a percentage (0-100) where 100% would mean the hard disk is spending 100% of its time with read or write, doesn't matter which. Of course you can convert it to a LED or a progress bar, include other drives (instance names are machine-specific but you can use
where name="_Total" for all), set up alerts (e.g. if activity > 50 do something), etc. Unfortunately I don't know any easy-to-use WMI tool for experimentation. I used BGInfo and Samurize's own WMI explorers.
Code:
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2");
function timercore1OnUpdate(Sender)
{
var perc_val = new Enumerator(wmi.ExecQuery("SELECT PercentDiskTime FROM Win32_PerfFormattedData_PerfDisk_PhysicalDisk where Name = '1 C: D:'"));
metDiskActivity.add(perc_val.item().PercentDiskTime);
}
Check out the attached file.
Attachment:
File comment: sample_widget
cyxw_-_copy.XWidgetPkg [2.33 KiB]
Downloaded 381 times