I want to get the following information about the disk performance.
I used MSStorageDriver_FailurePredictThresholds, MSStorageDriver_ATAPISmartData, MSStorageDriver_FailurePredictStatus class to get relative information but not getting the right result.
This isn't everything you wanted, but the Win32_PerfFormattedData_PerfDisk_PhysicalDisk WMI class gives you current read / write / transfer rate and activity time. It also gives some averages but I'm not sure how they are calculated (it seems odd that AvgDiskBytesPerWrite is 0)
// NOTE: Use ManagementObjectSearcher to find the path your interested in
var path = "Win32_PerfFormattedData_PerfDisk_PhysicalDisk.Name='0 C:'";
var wmiObj = new ManagementObject(path);
wmiObj.Properties.Cast<PropertyData>().ToDictionary(p => p.Name, p => p.Value).Dump();
/* OUTPUT */
AvgDiskBytesPerRead 63167
AvgDiskBytesPerTransfer 63167
AvgDiskBytesPerWrite 0
AvgDiskQueueLength 0
AvgDiskReadQueueLength 0
AvgDisksecPerRead 0
AvgDisksecPerTransfer 0
AvgDisksecPerWrite 0
AvgDiskWriteQueueLength 0
Caption null
CurrentDiskQueueLength 0
Description null
DiskBytesPersec 20991616
DiskReadBytesPersec 20991616
DiskReadsPersec 332
DiskTransfersPersec 332
DiskWriteBytesPersec 0
DiskWritesPersec 0
Frequency_Object null
Frequency_PerfTime null
Frequency_Sys100NS null
Name 0 C:
PercentDiskReadTime 80
PercentDiskTime 80
PercentDiskWriteTime 0
PercentIdleTime 32
SplitIOPerSec 0
Timestamp_Object null
Timestamp_PerfTime null
Timestamp_Sys100NS null
if you looking for this, check this Link. An example of output is:
###############################################################
Current Directory Path: D:\WinDDK\32bit\drivespeed
Total MB 230000, Free MB 103752, Used MB 126248
Windows Storage Speed Test 32-Bit Version 1.2, Thu Mar 01 22:31:08 2012
Copyright (C) Roy Longbottom 2011
8 MB File 1 2 3 4 5
Writing MB/sec 56.68 105.37 61.95 72.48 75.33
Reading MB/sec 80.65 108.15 81.10 81.42 82.25
16 MB File 1 2 3 4 5
Writing MB/sec 81.53 94.61 81.41 88.06 71.39
Reading MB/sec 88.25 72.75 93.53 93.51 92.70
32 MB File 1 2 3 4 5
Writing MB/sec 90.35 83.60 72.52 80.24 72.71
Reading MB/sec 87.00 87.67 78.39 80.24 78.62
---------------------------------------------------------------------
8 MB Cached File 1 2 3 4 5
Writing MB/sec 703.27 628.08 1050.99 1617.29 1609.70
Reading MB/sec 1930.60 2045.13 2054.49 2135.91 2390.08
---------------------------------------------------------------------
Bus Speed Block KB 64 128 256 512 1024
Reading MB/sec 174.36 189.07 221.83 247.82 261.21
---------------------------------------------------------------------
1 KB Blocks File MB > 2 4 8 16 32 64 128
Random Read msecs 0.14 0.14 0.15 0.17 3.24 6.96 8.90
Random Write msecs 0.53 0.66 1.03 1.38 1.74 1.83 2.42
---------------------------------------------------------------------
500 Files Write Read Delete
File KB MB/sec ms/File MB/sec ms/File Seconds
2 0.32 6.44 0.95 2.17 0.123
4 6.49 0.63 12.21 0.34 0.113
8 11.54 0.71 15.17 0.54 0.121
16 22.04 0.74 41.78 0.39 0.116
32 32.92 1.00 26.31 1.25 0.074
64 68.72 0.95 51.88 1.26 0.132
End of test Thu Mar 01 22:32:11 2012
Related
I have a BSOD 0x8E every day on five devices in same times on Windows 7.
Allways exception code - 04 - STATUS_SINGLE_STEP
as example:
1: kd> !analyze -v
*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************
KERNEL_MODE_EXCEPTION_NOT_HANDLED_M (1000008e)
This is a very common bugcheck. Usually the exception address pinpoints
the driver/function that caused the problem. Always note this address
as well as the link date of the driver/image that contains this address.
Some common problems are exception code 0x80000003. This means a hard
coded breakpoint or assertion was hit, but this system was booted
/NODEBUG. This is not supposed to happen as developers should never have
hardcoded breakpoints in retail code, but ...
If this happens, make sure a debugger gets connected, and the
system is booted /DEBUG. This will let us see why this breakpoint is
happening.
Arguments:
Arg1: 80000004, The exception code that was not handled
Arg2: ffdff2a5, The address that the exception occurred at
Arg3: a9c34d48, Trap Frame
Arg4: 00000000
Debugging Details:
------------------
DUMP_CLASS: 1
DUMP_QUALIFIER: 400
BUILD_VERSION_STRING: 7601.17514.x86fre.win7sp1_rtm.101119-1850
SYSTEM_MANUFACTURER: System manufacturer
SYSTEM_PRODUCT_NAME: System Product Name
SYSTEM_SKU: SKU
SYSTEM_VERSION: System Version
BIOS_VENDOR: American Megatrends Inc.
BIOS_VERSION: 1002
BIOS_DATE: 06/04/2013
BASEBOARD_MANUFACTURER: ASUSTeK COMPUTER INC.
BASEBOARD_PRODUCT: P8H61-I LX R2.0
BASEBOARD_VERSION: Rev X.0x
DUMP_TYPE: 2
BUGCHECK_P1: ffffffff80000004
BUGCHECK_P2: ffffffffffdff2a5
BUGCHECK_P3: ffffffffa9c34d48
BUGCHECK_P4: 0
EXCEPTION_CODE: (HRESULT) 0x80000004 (2147483652) - <Unable to get error code text>
FAULTING_IP:
+0
ffdff2a5 0000 add byte ptr [eax],al
TRAP_FRAME: a9c34d48 -- (.trap 0xffffffffa9c34d48)
ErrCode = 00000000
eax=00000000 ebx=846410c0 ecx=00000000 edx=00000000 esi=0c4cdb04 edi=00000000
eip=ffdff2a5 esp=a9c34dbc ebp=801ef000 iopl=0 ov dn di ng nz na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00004c86
ffdff2a5 0000 add byte ptr [eax],al ds:0023:00000000=??
Resetting default scope
CPU_COUNT: 2
CPU_MHZ: a8c
CPU_VENDOR: GenuineIntel
CPU_FAMILY: 6
CPU_MODEL: 3a
CPU_STEPPING: 9
CPU_MICROCODE: 6,3a,9,0 (F,M,S,R) SIG: 17'00000000 (cache) 17'00000000 (init)
CUSTOMER_CRASH_COUNT: 1
DEFAULT_BUCKET_ID: BAD_STACK_0x8E
BUGCHECK_STR: 0x8E
PROCESS_NAME: avp.exe
CURRENT_IRQL: 0
ANALYSIS_SESSION_HOST: NETMANNOTE
ANALYSIS_SESSION_TIME: 11-17-2017 12:11:18.0584
ANALYSIS_VERSION: 10.0.15063.468 x86fre
LAST_CONTROL_TRANSFER: from 00000000 to ffdff2a5
STACK_TEXT:
a9c34db8 00000000 0000027f 00000000 00000000 0xffdff2a5
STACK_COMMAND: .trap 0xffffffffa9c34d48 ; kb
SYMBOL_NAME: ANALYSIS_INCONCLUSIVE
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: Unknown_Module
IMAGE_NAME: Unknown_Image
DEBUG_FLR_IMAGE_TIMESTAMP: 0
BUCKET_ID: BAD_STACK_0x8E
PRIMARY_PROBLEM_CLASS: BAD_STACK
FAILURE_BUCKET_ID: BAD_STACK_0x8E
TARGET_TIME: 2017-11-16T13:53:07.000Z
OSBUILD: 7601
OSSERVICEPACK: 1000
SERVICEPACK_NUMBER: 0
OS_REVISION: 0
SUITE_MASK: 336
PRODUCT_TYPE: 1
OSPLATFORM_TYPE: x86
OSNAME: Windows 7
OSEDITION: Windows 7 WinNt (Service Pack 1) TerminalServer EmbeddedNT SingleUserTS
OS_LOCALE:
USER_LCID: 0
OSBUILD_TIMESTAMP: 2010-11-20 11:42:49
BUILDDATESTAMP_STR: 101119-1850
BUILDLAB_STR: win7sp1_rtm
BUILDOSVER_STR: 6.1.7601.17514.x86fre.win7sp1_rtm.101119-1850
ANALYSIS_SESSION_ELAPSED_TIME: cc3
ANALYSIS_SOURCE: KM
FAILURE_ID_HASH_STRING: km:bad_stack_0x8e
FAILURE_ID_HASH: {993602b9-6aa7-fbab-86a8-bb6ad81a3997}
Followup: MachineOwner
The service name can be different: av.exe, scvhost.ext,..
I know that is due to the a driver does not process STATUS_SINGLE_STEP exception.
Is any idea how to find wrong driver? There is no stack and module name in the dump...
I tried to run the Mirosoft Driver Verifier with standart flags and all drivers without Microsoft drivers, dump listing is above.
I am using C# MVC Razor.
Question:
I have a Multiline Text field with HTML, I use this field because I want no formatting at all. I just want to output the raw value.
example:
<path d="M610.7 357.9c-2.4-1.2-16.6-8.6-18.7-9.7 -7.5-3.8-10.1-7.2-10.1-12.9 0-8 6.5-13.1 16.7-13.1 6 0 11.7 2.6 15.1 4.5 0.6 0.3 1.3 0.5 2.1 0.5 2.4 0 4.3-1.9 4.3-4.3 0-1.6-0.9-3-2.2-3.7 -4.3-2.4-11.5-5.6-19.3-5.6 -14.9 0-25.3 8.9-25.3 21.7 0 11.5 7.5 16.9 14.9 20.7 2.1 1.1 16.5 8.5 18.7 9.6 5.7 3 8.9 7.5 8.9 12.6 0 6.9-5.9 14.3-16.7 14.3 -10.5 0-18.7-7.1-21-9.2l-0.7-0.6 -6.4 5.8 0.8 0.7c2.8 2.8 13.2 12 27.3 12 15.8 0 25.3-11.6 25.3-22.9C624.3 369.9 619.3 362.5 610.7 357.9z" />
Normally it outputs as:
<path d="M610.7 357.9c-2.4-1.2-16.6-8.6-18.7-9.7 -7.5-3.8-10.1-7.2-10.1-12.9 0-8 6.5-13.1 16.7-13.1 6 0 11.7 2.6 15.1 4.5 0.6 0.3 1.3 0.5 2.1 0.5 2.4 0 4.3-1.9 4.3-4.3 0-1.6-0.9-3-2.2-3.7 -4.3-2.4-11.5-5.6-19.3-5.6 -14.9 0-25.3 8.9-25.3 21.7 0 11.5 7.5 16.9 14.9 20.7 2.1 1.1 16.5 8.5 18.7 9.6 5.7 3 8.9 7.5 8.9 12.6 0 6.9-5.9 14.3-16.7 14.3 -10.5 0-18.7-7.1-21-9.2l-0.7-0.6 -6.4 5.8 0.8 0.7c2.8 2.8 13.2 12 27.3 12 15.8 0 25.3-11.6 25.3-22.9C624.3 369.9 619.3 362.5 610.7 357.9z" />
So I wrapped the value in:
#WebUtility.HtmlDecode(complexShapes)
With no change. How can I get this value as is?
If your model values are set as follows in your controller:
model.ComplexShapes =
"<path d=\"M610.7 357.9c-2.4-1.2-16.6-8.6-18.7-9.7 -7.5-3.8-10.1-7.2-10.1-12.9 0-8 6.5-13.1 16.7-13.1 6 0 11.7 2.6 15.1 4.5 0.6 0.3 1.3 0.5 2.1 0.5 2.4 0 4.3-1.9 4.3-4.3 0-1.6-0.9-3-2.2-3.7 -4.3-2.4-11.5-5.6-19.3-5.6 -14.9 0-25.3 8.9-25.3 21.7 0 11.5 7.5 16.9 14.9 20.7 2.1 1.1 16.5 8.5 18.7 9.6 5.7 3 8.9 7.5 8.9 12.6 0 6.9-5.9 14.3-16.7 14.3 -10.5 0-18.7-7.1-21-9.2l-0.7-0.6 -6.4 5.8 0.8 0.7c2.8 2.8 13.2 12 27.3 12 15.8 0 25.3-11.6 25.3-22.9C624.3 369.9 619.3 362.5 610.7 357.9z\" />";
You can simply use #HtmlRaw to output it:
#Html.Raw(Model.ComplexShapes)
Screen Grab
Working Fiddle
Difficult to say without seeing your code that actually handles the field value and returns it.
Normally you would do something like this:
return new HtmlString(myFieldValue);
to instruct the framework that the string is ready to present as-is.
I've concatenated a series of VOB files from a DVD into a single VOB file and I am trying to convert it to MP4 or other similar format. I see a lot of errors when converting and the output appears scrambled.
>ffmpeg.exe" -i file.vob -sameq file.mp4
FFmpeg version git-N-29181-ga304071, Copyright (c) 2000-2011 the FFmpeg develope
rs
built on Apr 18 2011 21:24:03 with gcc 4.5.2
configuration: --enable-gpl --enable-version3 --enable-runtime-cpudetect --ena
ble-memalign-hack --enable-avisynth --enable-bzlib --enable-frei0r --enable-libo
pencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --
enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enabl
e-libx264 --enable-libxavs --enable-libxvid --enable-zlib --cross-prefix=i686-w6
4-mingw32- --target-os=mingw32 --arch=x86_32 --extra-cflags=-I/home/kyle/softwar
e/ffmpeg/external-libraries/win32/include --extra-ldflags=-L/home/kyle/software/
ffmpeg/external-libraries/win32/lib --pkg-config=pkg-config
libavutil 50. 40. 1 / 50. 40. 1
libavcodec 52.120. 0 / 52.120. 0
libavformat 52.108. 0 / 52.108. 0
libavdevice 52. 4. 0 / 52. 4. 0
libavfilter 1. 79. 0 / 1. 79. 0
libswscale 0. 13. 0 / 0. 13. 0
[mpeg2video # 01751A90] ac-tex damaged at 5 16
[mpeg2video # 01751A90] invalid mb type in I Frame at 0 1
[mpeg2video # 01751A90] invalid mb type in I Frame at 0 2
[mpeg2video # 01751A90] invalid mb type in I Frame at 0 3
[mpeg2video # 01751A90] invalid mb type in I Frame at 0 4
[...]
I'm guessing this is CSS scrambling and I need to do some sort of DeCSS. Does FFMpeg have an option for this? Cringe if you'd like, but is there C# source to achieve this?
My end goal is really just to get some DVDs that I own onto my media server. I've tried a few demo-ware products with limited success including Acala DVD Ripper, Click to Disk, AVIDemux to name a few. I even paid for a couple of them to get the full version, but Acala only works for about half of my DVDs and Click to Disk can decode the VOB, but I need to use FFMpeg to convert. I'd like to have it all in one app that works and I am willing to write some code for it.
I am saving some of the rendered html of a web site by overriding the Render method and using HtmlAgilityPack. Here is the code:
protected override void Render(HtmlTextWriter writer)
{
using (HtmlTextWriter htmlwriter = new HtmlTextWriter(new StringWriter()))
{
base.Render(htmlwriter);
string output= htmlwriter.InnerWriter.ToString();
var doc = new HtmlDocument();
doc.LoadHtml(output);
doc.Save(currDir + "\\" + reportDir + "\\dashboardTable.html");
}
}
However, some process does not let go of the saved file and I am unable to delete it from the server. Does anyone know of an HtmlAgilityPack issue that would cause this?
Any advice is appreciated.
Regards.
EDIT:
I have tried both of the methods suggested. I can't tell if they are the solution yet because my app is frozen on the server due to the files I can't delete. However, when I use these solutions on my own machine, the rendered HTML does not save as an HTML table anymore but rather like this:
INCIDENT MANAGEMENT
Jul '12 F'12
Trend F'12 2011
(avg)
Severe Incidents (Sev1/2): 3 2.1 4.16
Severe Avoidable Incidents (Sev1/2): 1 1.3 1.91
Incidents (Sev3): 669 482 460.92
Incidents (Sev4) - No business Impact: 1012 808 793
Proactive Tickets Opened: 15 19.3 14
Proactive Tickets Resolved/Closed: 14 17.3 11
CHANGE MANAGEMENT
Total Planned Changes: 531 560 583.58
Change Success Rate (%): 99.5 99.4 99
Non-Remedial Urgent Changes: 6 11 47.08
PROBLEM MANAGEMENT
New PIRs: 2 1.4 2
Closed PIRs: 0 2 3
Overdue Action items: 2 3.2 0
COMPLIANCE MEASUREMENTS
Jul Trend Jun
Total Number of Perimeter Devices: 250 258
Perimeter Devices - Non Compliant: 36 31
Total Number of Internal Devices: 6676 6632
Internal Devices - Non Compliant: 173 160
Unauthorized Perimeter Changes: 0 0
Unauthorized Internal Changes 0 0
LEGEND
ISP LINKS
July June Trend
SOC CPO DRP SOC CPO DRP
40% 34% 74% 39% 35% 74%
BELL MPLS HEAD ENDS
July June Trend
SOC CPO SOC CPO
8% 5% 7% 10% 8% 5.5% 7% 10%
ENTERPRISE NETWORK (# of issues called out)
July June Trend
CORE FW/DMZ CORE FW/DMZ
1 0 1 0
US & INTL (# of issues called out)
July June Trend
US Intl US Intl
2 2 2 3
LINE OF BUSINESS BELL WAN MPLS
<> 50%-65% >65% <> 50%-65% >65% Trend
Retail: 2272 0 1 2269 4 0
Business Banking: 59 1 0 60 0 0
Wealth: 122 2 0 121 2 1
Corporate: 51 0 0 49 2 0
Remote ATM: 280 0 0 280 0 0
TOOLS
Version Currency Vulnerability Status Health Status
Key Messages:
where only the text data has been saved and all of the HTML and CSS is missing. If I just use doc.Save() I get an exact representation of the table as it displays on the website.
Try this instead. Maybe the Save method isn't closing the underlying stream.
using( FileStream stream = File.OpenWrite( currDir + "\\" + reportDir + "\\dashboardTable.html" ) ){
doc.Save(stream);
stream.Close();
}
Edit
Per #L.B's comments it appears that HtmlAgilityPack does use a using block as in my example so it will be ensuring that the stream gets closed.
Thus as I suggested at the end of my original answer this must be a server environment problem
Original Answer
This may be some sort of bug with HtmlAgilityPack - you may want to report it to the developers.
However to eliminate that possibility you may want to consider explicitly controlling the creation of the StreamWriter for the file so you are explicitly closing it yourself. Replace this line:
doc.Save(currDir + "\\" + reportDir + "\\dashboardTable.html");
With the following:
using (StreamWriter fileWriter = new StreamWriter(currDir + "\\" + reportDir + "\\dashboardTable.html"))
{
doc.Save(fileWriter);
fileWriter.Close();
}
If the issue still persists even with this change then that would suggest an issue with your server environment rather than an issue with HtmlAgilityPack. Btw to test if this change makes a difference you should start from a clean server environment rather than one where you are already having issues deleting the file in question.
I have a web site that displays a table along with some buttons, navigation tabs, etc. Using HtmlAgilityPack I would like to save only the node containing the table (a div) to a .html file. I have been experimenting with this code:
string dashboard = doc.DocumentNode.SelectSingleNode("//div[#id='Dashboard']").InnerHtml;
doc.LoadHtml(dashboard);
doc.Save(currDir + "\\dashboardOutputFile.html");
But this only preserves the text components of the table and none of its layout/display information. I have tried adding a Doctype declaration as well as enclosing html and body tags to the dashboard string but it has no effect.
Any advice is appreciated.
Regards.
EDIT:
I should be more explicit. I am capturing the html of my page by overriding the Render method:
protected override void Render(HtmlTextWriter writer)
{
using (HtmlTextWriter htmlwriter = new HtmlTextWriter(new StringWriter()))
{
base.Render(htmlwriter);
string renderedContent = htmlwriter.InnerWriter.ToString();
var doc = new HtmlDocument();
doc.LoadHtml(renderedContent);
try
{
string dashboard = doc.DocumentNode.SelectSingleNode("//div[#id='Dashboard']").InnerHtml;
dashboard = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><br><html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body><div><br>" + dashboard + "<br></div></body></html>";
doc.LoadHtml(dashboard);
doc.Save(currDir + "\\dashboardOutputFile.html");
}
catch (NullReferenceException ex)
{
// Do nothing.
}
writer.Write(renderedContent);
}
}
To the best of my knowledge the string "dashboard" should contain a complete HTML page after this. However the resulting .html file displays like this:
INCIDENT MANAGEMENT
Jun '12 F'12
Trend F'12 2011
(avg)
Severe Incidents (Sev1/2): 2 2 4.16
Severe Avoidable Incidents (Sev1/2): 1 1.3 1.91
Incidents (Sev3): 600 459 460.92
Incidents (Sev4) - No business Impact: 869 782 793
Proactive Tickets Opened: 24 20 14
Proactive Tickets Resolved/Closed: 22 17.8 11
CHANGE MANAGEMENT
Total Planned Changes: 623 564 583.58
Change Success Rate (%): 99.9 99.4 99
Non-Remedial Urgent Changes: 5 11.4 47.08
PROBLEM MANAGEMENT
New PIRs: 1 1.4 2
Closed PIRs: 1 2.3 3
Overdue Action items: 2 3.4 0
COMPLIANCE MEASUREMENTS
Jun Trend May
Total Number of Perimeter Devices: 258 242
Perimeter Devices - Non Compliant: 31 7
Total Number of Internal Devices: 6632 6521
Internal Devices - Non Compliant: 160 38
Unauthorized Perimeter Changes: 0 0
Unauthorized Internal Changes 0 0
LEGEND
ISP LINKS
June May Trend
SOC CPO DRP SOC CPO DRP
39% 35% 74% 38% 35% 73%
BELL MPLS HEAD ENDS
June May Trend
SOC CPO SOC CPO
8% 5.5% 7% 10% 7.5% 5% 6% 10%
ENTERPRISE NETWORK (# of issues called out)
June May Trend
CORE FW/DMZ CORE FW/DMZ
1 0 1 0
US & INTL (# of issues called out)
June May Trend
US Intl US Intl
2 3 2 3
LINE OF BUSINESS BELL WAN MPLS
<> 50%-65% >65% <> 50%-65% >65% Trend
Retail: 2269 4 0 2271 2 0
Business Banking: 60 0 0 51 1 0
Wealth: 121 2 1 111 3 2
Corporate: 49 2 0 51 1 1
Remote ATM: 280 0 0 279 0 0
TOOLS
Version Currency Vulnerability Status Health Status
Key Messages:
Only the text of the table cells is being displayed. There is no table layout, no background colours, etc. Even when I copy the file into JSFiddle it displays like this. What am I missing to make this a complete HTML page?
There's probably a css file linked into the original html not being read in your downloaded page.