diff options
author | Andreas N <andreas@mono-cvs.ximian.com> | 2003-07-14 02:12:52 +0400 |
---|---|---|
committer | Andreas N <andreas@mono-cvs.ximian.com> | 2003-07-14 02:12:52 +0400 |
commit | caa00be083821a8ede8a74bb3414e8ffd0785edf (patch) | |
tree | 89860471267ac17104ef8f0e66dca8787a639145 /mcs/class/System/System.Diagnostics | |
parent | 78dc7ab616ff9c86f63ba9eb79bccba9bad6d754 (diff) |
2003-07-13 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* PerformanceCounter: Implemented or implementation added
svn path=/trunk/mcs/; revision=16178
Diffstat (limited to 'mcs/class/System/System.Diagnostics')
-rw-r--r-- | mcs/class/System/System.Diagnostics/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/System/System.Diagnostics/PerformanceCounter.cs | 236 |
2 files changed, 143 insertions, 97 deletions
diff --git a/mcs/class/System/System.Diagnostics/ChangeLog b/mcs/class/System/System.Diagnostics/ChangeLog index 5909a53d2b3..d62a20148c3 100644 --- a/mcs/class/System/System.Diagnostics/ChangeLog +++ b/mcs/class/System/System.Diagnostics/ChangeLog @@ -1,5 +1,9 @@ 2003-07-13 Andreas Nahr <ClassDevelopment@A-SoftTech.com> + * PerformanceCounter: Implemented or implementation added + +2003-07-13 Andreas Nahr <ClassDevelopment@A-SoftTech.com> + * DiagnosticsConfigurationHandler.cs: Removed a never used variable * EventLog.cs: Small update to prevent a warning * EventLogPermission.cs: Implemented or implementation added diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounter.cs b/mcs/class/System/System.Diagnostics/PerformanceCounter.cs index 2e7f50478d3..6a05c3bcb0c 100644 --- a/mcs/class/System/System.Diagnostics/PerformanceCounter.cs +++ b/mcs/class/System/System.Diagnostics/PerformanceCounter.cs @@ -3,18 +3,29 @@ // // Authors: // Jonathan Pryor (jonpryor@vt.edu) +// Andreas Nahr (ClassDevelopment@A-SoftTech.com) // // (C) 2002 +// (C) 2003 Andreas Nahr // using System; using System.ComponentModel; +using System.ComponentModel.Design; using System.Diagnostics; namespace System.Diagnostics { // must be safe for multithreaded operations - public class PerformanceCounter : Component, ISupportInitialize { + #if (NET_1_0) + [Designer ("Microsoft.VisualStudio.Install.PerformanceCounterDesigner, Microsoft.VisualStudio, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (IDesigner))] + #endif + #if (NET_1_1) + [Designer ("Microsoft.VisualStudio.Install.PerformanceCounterDesigner, Microsoft.VisualStudio, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (IDesigner))] + #endif + [InstallerType (typeof (PerformanceCounterInstaller))] + public sealed class PerformanceCounter : Component, ISupportInitialize + { private string categoryName; private string counterName; @@ -22,8 +33,7 @@ namespace System.Diagnostics { private string machineName; private bool readOnly; - [MonoTODO("Find the actual value")] - public static int DefaultFileMappingSize = 0x80000; + public static int DefaultFileMappingSize = 524288; // set catname, countname, instname to "", machname to "." public PerformanceCounter () @@ -83,6 +93,13 @@ namespace System.Diagnostics { } // may throw ArgumentNullException + [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)] + #if (NET_1_0) + [TypeConverter ("System.Diagnostics.Design.CategoryValueConverter, System.Design, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + #endif + #if (NET_1_1) + [TypeConverter ("System.Diagnostics.Design.CategoryValueConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + #endif public string CategoryName { get {return categoryName;} set { @@ -92,14 +109,24 @@ namespace System.Diagnostics { } } -// // may throw InvalidOperationException -// [MonoTODO] -// public string CounterHelp { -// get {return "";} -// } -// + // may throw InvalidOperationException + [MonoTODO] + [ReadOnly (true), DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] + [MonitoringDescription ("A description describing the counter.")] + public string CounterHelp { + get {return "";} + } + // may throw ArgumentNullException - public string CounterName { + [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)] + #if (NET_1_0) + [TypeConverter ("System.Diagnostics.Design.CounterNameConverter, System.Design, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + #endif + #if (NET_1_1) + [TypeConverter ("System.Diagnostics.Design.CounterNameConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + #endif + public string CounterName + { get {return counterName;} set { if (value == null) @@ -108,109 +135,124 @@ namespace System.Diagnostics { } } -// // may throw InvalidOperationException -// [MonoTODO] -// public PerformanceCounterType CounterType { -// get {return 0;} -// } -// - public string InstanceName { + // may throw InvalidOperationException + [MonoTODO] + [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] + [MonitoringDescription ("The type of the counter.")] + public PerformanceCounterType CounterType { + get {return 0;} + } + + [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)] + #if (NET_1_0) + [TypeConverter ("System.Diagnostics.Design.InstanceNameConverter, System.Design, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + #endif + #if (NET_1_1) + [TypeConverter ("System.Diagnostics.Design.InstanceNameConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + #endif + public string InstanceName + { get {return instanceName;} set {instanceName = value;} } -// // may throw ArgumentException if machine name format is wrong -// [MonoTODO("What's the machine name format?")] -// public string MachineName { -// get {return machineName;} -// set {machineName = value;} -// } -// -// // may throw InvalidOperationException, Win32Exception -// [MonoTODO] -// public long RawValue { -// get {return 0;} -// set { -// throw new NotImplementedException (); -// } -// } -// -// public bool ReadOnly { -// get {return readOnly;} -// set {readOnly = value;} -// } -// + // may throw ArgumentException if machine name format is wrong + [MonoTODO("What's the machine name format?")] + [DefaultValue ("."), Browsable (false), RecommendedAsConfigurable (true)] + public string MachineName { + get {return machineName;} + set {machineName = value;} + } + + // may throw InvalidOperationException, Win32Exception + [MonoTODO] + [Browsable (false), DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] + [MonitoringDescription ("The raw value of the counter.")] + public long RawValue { + get {return 0;} + set { + throw new NotImplementedException (); + } + } + + [Browsable (false), DefaultValue (true)] + [MonitoringDescription ("The accessability level of the counter.")] + public bool ReadOnly { + get {return readOnly;} + set {readOnly = value;} + } + [MonoTODO] public void BeginInit () { throw new NotImplementedException (); } -// [MonoTODO] -// public void Close () -// { -// throw new NotImplementedException (); -// } -// -// [MonoTODO] -// public static void CloseSharedResources () -// { -// throw new NotImplementedException (); -// } -// -// // may throw InvalidOperationException, Win32Exception -// [MonoTODO] -// public long Decrement () -// { -// throw new NotImplementedException (); -// } -// -// [MonoTODO] -// protected override void Dispose (bool disposing) -// { -// throw new NotImplementedException (); -// } -// + [MonoTODO] + public void Close () + { + throw new NotImplementedException (); + } + + [MonoTODO] + public static void CloseSharedResources () + { + throw new NotImplementedException (); + } + + // may throw InvalidOperationException, Win32Exception + [MonoTODO] + public long Decrement () + { + throw new NotImplementedException (); + } + + [MonoTODO] + protected override void Dispose (bool disposing) + { + throw new NotImplementedException (); + } + [MonoTODO] public void EndInit () { throw new NotImplementedException (); } -// // may throw InvalidOperationException, Win32Exception -// [MonoTODO] -// public long Increment () -// { -// throw new NotImplementedException (); -// } -// -// // may throw InvalidOperationException, Win32Exception -// [MonoTODO] -// public long IncrementBy (long value) -// { -// throw new NotImplementedException (); -// } -// -// // may throw InvalidOperationException, Win32Exception -// [MonoTODO] -// public CounterSample NextSample () -// { -// throw new NotImplementedException (); -// } -// -// // may throw InvalidOperationException, Win32Exception -// [MonoTODO] -// public float NextValue () -// { -// throw new NotImplementedException (); -// } -// -// // may throw InvalidOperationException, Win32Exception -// [MonoTODO] -// public void RemoveInstance () -// { -// throw new NotImplementedException (); -// } + // may throw InvalidOperationException, Win32Exception + [MonoTODO] + public long Increment () + { + throw new NotImplementedException (); + } + + // may throw InvalidOperationException, Win32Exception + [MonoTODO] + public long IncrementBy (long value) + { + throw new NotImplementedException (); + } + + // may throw InvalidOperationException, Win32Exception + [MonoTODO] + public CounterSample NextSample () + { + throw new NotImplementedException (); + } + + // may throw InvalidOperationException, Win32Exception + [MonoTODO] + public float NextValue () + { + throw new NotImplementedException (); + } + + // may throw InvalidOperationException, Win32Exception + [MonoTODO] + public void RemoveInstance () + { + throw new NotImplementedException (); + } } } |