Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

NTime - Performance unit testing tool

, 30 Mar 2006
An article on a performance testing tool to test an application against its performance.
ntime_demo.zip
Installer
1.1
NTimeSetup.msi
Setup.Exe
Setup.Ini
2.0
NTimeSetup.msi
setup.exe
ntime_sdk.zip
NTime Framework SDK Documentation.chm
ntime_src.zip
src
Framework
License.rtf
ntime.snk
NTimeConsole
App.ico
NTimeGUI
folder.bmp
folder2.bmp
gray.bmp
green.bmp
NTime.ico
red.bmp
yellow.bmp
NTimeSetup
NTimeSetup.vdproj
PerformanceTests
Readme.rtf
ntime_src_11.zip
NTime_src_1.1
Framework
.VPUML
.history
.historyinfo_NTime.Framework.dll
NTime.Framework.dll.vpp.v1
NTime.Framework.dll.vpp
bin
Release
NTime.Framework.dll
ModelSupport
default.txvpck
NTime
Framework
Framework.txvpck
NTime.txvpck
mssccprj.scc
NTime.Framework
NTime.Framework.dll.csproj.user
NTime.Framework.dll.csproj.vspscc
vssver.scc
ntime.snk
NTimeAddin
bin
Release
NTimeAddin.dll
NTimeAddin.tlb
NTimeAddin.csproj.user
NTimeAddinSetup
NTimeAddinSetup.vdproj
NTimeConsole
App.ico
bin
Release
NTime.exe
NTimeConsole.exe
ModelSupport
mssccprj.scc
NTime.csproj.user
NTime.csproj.vspscc
vssver.scc
NTimeGUI
.VPUML
.history
.historyinfo_NTimeGUI
NTimeGUI.vpp.v1
NTimeGUI.vpp
bin
Release
NTimeGUI.exe
folder.bmp
folder2.bmp
gray.bmp
green.bmp
ModelSupport
default.txvpck
NTime
GUI
GUI.txvpck
NTime.txvpck
mssccprj.scc
NTime.ico
NTimeGUI.csproj.user
NTimeGUI.csproj.vspscc
out
doc
doc-files
default.gif
gendoc.gdc
model-tree
false.gif
model.tree
ST_Attribute.gif
ST_Class Diagram.gif
ST_Class.gif
ST_Operation.gif
ST_Package Diagram.gif
ST_Package.gif
ST_Project.gif
true.gif
navigation.jar
NTime
doc-files
NTime.gif
GUI
doc-files
Class Diagram1.gif
GUI.gif
red.bmp
vssver.scc
yellow.bmp
NTimeSetup
mssccprj.scc
NTimeSetup.vdproj
NTimeSetup.vdproj.vspscc
vssver.scc
PerformanceTests
bin
Release
PerformanceTests.dll
PerformanceTests.ntime
ModelSupport
PerformanceTests
mssccprj.scc
PerformanceTests.csproj.user
PerformanceTests.csproj.vspscc
vssver.scc
ntime_src_20.zip
NTime_src_2.0
Framework
.VPUML
.history
.historyinfo_NTime.Framework.dll
NTime.Framework.dll.vpp.v1
NTime.Framework.dll.vpp
bin
Release
NTime.Framework.dll
ModelSupport
default.txvpck
NTime
Framework
Framework.txvpck
NTime.txvpck
mssccprj.scc
NTime.Framework
NTime.Framework.dll
NTime.Framework.dll.csproj.user
NTime.Framework.dll.csproj.vspscc
Properties
vssver.scc
NTimeConsole
App.ico
bin
Release
NTime.exe
NTime.Framework.dll
NTimeConsole.exe
ModelSupport
mssccprj.scc
NTime.csproj.user
NTime.csproj.vspscc
Properties
vssver.scc
NTimeGUI
.VPUML
.history
.historyinfo_NTimeGUI
NTimeGUI.vpp.v1
NTimeGUI.vpp
bin
Release
NTime.Framework.dll
NTimeGUI.exe
folder.bmp
folder2.bmp
gray.bmp
green.bmp
ModelSupport
default.txvpck
NTime
GUI
GUI.txvpck
NTime.txvpck
mssccprj.scc
NTime.ico
NTimeGUI.csproj.user
NTimeGUI.csproj.vspscc
out
doc
doc-files
default.gif
gendoc.gdc
model-tree
false.gif
model.tree
ST_Attribute.gif
ST_Class Diagram.gif
ST_Class.gif
ST_Operation.gif
ST_Package Diagram.gif
ST_Package.gif
ST_Project.gif
true.gif
navigation.jar
NTime
doc-files
NTime.gif
GUI
doc-files
Class Diagram1.gif
GUI.gif
Properties
red.bmp
vssver.scc
yellow.bmp
NTimeSetup
mssccprj.scc
NTimeSetup.vdproj
NTimeSetup.vdproj.vspscc
vssver.scc
PerformanceTests
bin
Release
NTime.Framework.dll
PerformanceTests.dll
PerformanceTests.ntime
ModelSupport
PerformanceTests
mssccprj.scc
PerformanceTests.csproj.user
PerformanceTests.csproj.vspscc
Properties
vssver.scc
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>NTime.Framework</name>
    </assembly>
    <members>
        <member name="T:NTime.Framework.TimePeriod">
            <summary>
            Time period constants used by <see cref="T:NTime.Framework.TimerHitCountTestAttribute"/> and <see cref="T:NTime.Framework.TimerDurationTestAttribute"/>.
            </summary>
            <example>
            Followed example shows how to set time period to 10 times per second in <see cref="T:NTime.Framework.TimerHitCountTestAttribute"/>.
            <code>
            [TimerHitCountTest(10, Unit = TimePeriod.Second)]
            </code>
            </example>
            <remarks>Time periods are customizable units for different time frames of code performance tests.
            Sometimes you need to keep your hit count of method execution to be not less than 300 times per second, this
            would be typical scenario for real server applications. Other time frame would be used in critical sections, therefore
            time period should be set to nanoseconds probably.
            </remarks>
        </member>
        <member name="F:NTime.Framework.TimePeriod.Nanosecond">
            <summary>
            Time period is set to one nanosecond. Use this value in critical sections to collect performance test.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimePeriod.Microsecond">
            <summary>
            Time period is set to one microsecond. This is default value for <see cref="T:NTime.Framework.TimerDurationTestAttribute"/>.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimePeriod.Millisecond">
            <summary>
            Time period is set to one millisecond.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimePeriod.Second">
            <summary>
            Time period is set to one second. This is default value for <see cref="T:NTime.Framework.TimerHitCountTestAttribute"/>.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimePeriod.Minute">
            <summary>
            Time period is set to one minute. You can use this value in complex task as database transactions.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimePeriod.Hour">
            <summary>
            Time period is set to one hour.
            </summary>
        </member>
        <member name="T:NTime.Framework.TimerFixtureAttribute">
            <summary>
            Specifies timing usage for user class.
            This class cannot be inherited.
            </summary>
            <remarks>This is main attribute your class must have to enable perfomance tests.
            </remarks>
            <example>Mark your class as follow, to make it dedicated to run performance tests.
            <code>
            [TimerFixture]
            public class ServerPerformanceTest
            {
            	...
            }
            </code></example>
        </member>
        <member name="T:NTime.Framework.TimerHitCountTestAttribute">
            <summary>
            Specifies hit count test for the method.
            This class cannot be inherited.
            </summary>
            <remarks>This attribute marks methods in <see cref="T:NTime.Framework.TimerFixtureAttribute"/> attributed class to provide
            hit count performance tests in methods. Performance is completed when hit count is above minimum value per certain time period, otherwise test fails.
            It is useful performance test to keep your application code more responsible to clients. Default time period is one second.</remarks>
            <example>Attribute method for hit count performance test of minimum 20 calls per millisecond is shown below.
            <code>
            [TimerFixture]
            public class TestPerformance
            {
            	[TimerHitCountTest(20, Unit = Millisecond)]
            	public void RunTest()
            	{
            		...
            	}
            }
            </code></example>
        </member>
        <member name="F:NTime.Framework.TimerHitCountTestAttribute.ExpectedHits">
            <summary>
            Minimum hits per second (or other time period) that must occur, otherwise performance test fails.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimerHitCountTestAttribute.Threads">
            <summary>
            Number of concurrent threads that call method.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimerHitCountTestAttribute.Unit">
            <summary>
            Time period for hit count calculating.
            </summary>
        </member>
        <member name="M:NTime.Framework.TimerHitCountTestAttribute.#ctor(System.Int32)">
            <summary>
            Initializes a new instance of attribute class to enable method hit count test.
            Optionally specify <see cref="F:NTime.Framework.TimerHitCountTestAttribute.Threads"/> for multithreaded tests and
            <see cref="F:NTime.Framework.TimerHitCountTestAttribute.Unit"/> with one of available <see cref="T:NTime.Framework.TimePeriod"/> constant to change time unit (defaults to second).
            </summary>
            <param name="expectedHits">Minimum hits per second (or other time period) that must occur, otherwise performance test fails.</param>
        </member>
        <member name="T:NTime.Framework.TimerDurationTestAttribute">
            <summary>
            Specifies duration test.
            This class cannot be inherited.
            </summary>
            <remarks>This attribute marks methods in <see cref="T:NTime.Framework.TimerFixtureAttribute"/> class to provide
            duration performance tests. Performance test is completed when time execution is less than minimum provided time in certain time unit, otherwise test fails.
            It is useful performance test to keep your application code run fast. Default time unit is microseconds.</remarks>
            <example>Attribute method for duration performance test of maximum 60 nanoseconds is shown below.
            <code>
            [TimerFixture]
            public class TestPerformance
            {
            	[TimerDurationTest(60, Unit = Nanosecond)]
            	public void RunTest()
            	{
            		...
            	}
            }
            </code></example>
        </member>
        <member name="F:NTime.Framework.TimerDurationTestAttribute.Duration">
            <summary>
            Minimum time (defaults to microseconds) the method has to be executed, otherwise performance test fails.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimerDurationTestAttribute.Threads">
            <summary>
            Number of concurrent threads that call method.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimerDurationTestAttribute.Unit">
            <summary>
            Time period for duration test.
            </summary>
        </member>
        <member name="M:NTime.Framework.TimerDurationTestAttribute.#ctor(System.Int32)">
            <summary>
            Initializes attribute class for method time execution.
            Optionally specify <see cref="F:NTime.Framework.TimerDurationTestAttribute.Threads"/> for multithreaded tests and
            <see cref="F:NTime.Framework.TimerDurationTestAttribute.Unit"/> with one of available <see cref="T:NTime.Framework.TimePeriod"/> constant to change measure (defaults to microseconds).
            </summary>
            <param name="duration">Minimum time (defaults to microseconds) the method has to be executed, otherwise performance test fails.</param>
        </member>
        <member name="T:NTime.Framework.TimerCounterTestAttribute">
            <summary>
            Specifies method to test against performance counters.
            This class cannot be inherited.
            </summary>
            <remarks>This attribute marks methods in <see cref="T:NTime.Framework.TimerFixtureAttribute"/> class to provide
            custom performance counter tests in methods. Performance test is completed when average performance counter value is in range of minimum and maximum value set (set at least one value), otherwise test fails.
            It is useful performance test to keep your application run smoothly with many performance counter checks. For more information refer to <see cref="T:System.Diagnostics.PerformanceCounter"/>.
            Note that you can specify in a special string '*' in member <see cref="F:NTime.Framework.TimerCounterTestAttribute.InstanceName"/> to fetch actual application name i.e. either NTimeGUI or NTime.
            </remarks>
        </member>
        <member name="F:NTime.Framework.TimerCounterTestAttribute.CategoryName">
            <summary>
            The name of the performance counter category for performance counter.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimerCounterTestAttribute.CounterName">
            <summary>
            The name of the performance counter that is associated with PerformanceCounter instance.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimerCounterTestAttribute.InstanceName">
            <summary>
            The instance name for performance counter, note that you can specify here special string '*' to fetch actual application name i.e. either NTimeGUI or NTime.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimerCounterTestAttribute.MachineName">
            <summary>
            The computer name for performance counter. Do not use this member, because is not supported.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimerCounterTestAttribute.Threads">
            <summary>
            Number of concurrent threads that call method.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimerCounterTestAttribute.MinimumValue">
            <summary>
            Minimum value that performance counter may have to accept performance test.
            </summary>
        </member>
        <member name="F:NTime.Framework.TimerCounterTestAttribute.MaximumValue">
            <summary>
            Maximum value that performance counter may have to accept performance test.
            </summary>
        </member>
        <member name="M:NTime.Framework.TimerCounterTestAttribute.#ctor(System.String,System.String)">
            <summary>
            Initializes attribute class to test method against performance counters.
            Optionally specify <see cref="F:NTime.Framework.TimerCounterTestAttribute.Threads"/> for multithreaded
            tests, <see cref="F:NTime.Framework.TimerCounterTestAttribute.InstanceName"/>, <see cref="F:NTime.Framework.TimerCounterTestAttribute.MachineName"/>,
            minimum and/or maximum acceptable value for perfomance counter <see cref="F:NTime.Framework.TimerCounterTestAttribute.MinimumValue"/>, <see cref="F:NTime.Framework.TimerCounterTestAttribute.MaximumValue"/>.
            See also <see cref="T:System.Diagnostics.PerformanceCounter"/> class.
            <seealso cref="T:System.Diagnostics.PerformanceCounter"/>
            </summary>
            <param name="categoryName">The name of the performance counter category for performance counter.</param>
            <param name="counterName">The name of the performance counter that is associated with PerformanceCounter instance.</param>
        </member>
        <member name="T:NTime.Framework.TimerSetUpAttribute">
            <summary>
            Specifies place to set up environment with TimerFixture class.
            This class cannot be inherited.
            </summary>
            <remarks>This attribute when used with method prepares additional set up for your performance test methods.
            It is not required to specify this attribute always, some methods may still work without TimerSetUp attribute.
            Every <see cref="T:NTime.Framework.TimerFixtureAttribute"/> class may have its own TimerSetUpAttribute or <see cref="T:NTime.Framework.TimerTearDownAttribute"/> as well.</remarks>
            <example>Mark your class as follows:
            <code>
            [TimerSetUp]
            public void PerformanceSetUpRoutine
            {
            	...
            }
            </code></example>
        </member>
        <member name="T:NTime.Framework.TimerTearDownAttribute">
            <summary>
            Specifies place to tear down environment with TimerFixture class.
            This class cannot be inherited.
            </summary>
            <remarks>This attribute when used with method frees additional objects created by <see cref="T:NTime.Framework.TimerSetUpAttribute"/> class.
            It is not required to specify this attribute always, some methods may still work without TimerTearDown attribute.
            Every <see cref="T:NTime.Framework.TimerFixtureAttribute"/> class may have its own TimerTearDownAttribute or <see cref="T:NTime.Framework.TimerSetUpAttribute"/> as well.</remarks>
            <example>Mark your class as follows:
            <code>
            [TimerTearDown]
            public void PerformanceTearDownRoutine
            {
            	...
            }
            </code></example>
        </member>
        <member name="T:NTime.Framework.TimerFixtureSetUpAttribute">
            <summary>
            Specifies place for global set up environment for whole performance test.
            This class cannot be inherited.
            </summary>
            <remarks>This attribute when used with method prepares main set up for your performance test.
            It is not required to specify this attribute.</remarks>
            <example>Mark your class as follows:
            <code>
            [TimerFixtureSetUp]
            public void PerformanceGlobalSetUpRoutine
            {
            	...
            }
            </code></example>
        </member>
        <member name="T:NTime.Framework.TimerFixtureTearDownAttribute">
            <summary>
            Specifies place to globally tear down environment for whole performance test.
            This class cannot be inherited.
            </summary>
            <remarks>This attribute when used with method at the end of performance test frees additional objects created by <see cref="T:NTime.Framework.TimerFixtureSetUpAttribute"/> class.
            It is not required to specify this attribute.</remarks>
            <example>Mark your class as follows:
            <code>
            [TimerFixtureTearDown]
            public void PerformanceGlobalTearDownRoutine
            {
            	...
            }
            </code></example>
        </member>
        <member name="T:NTime.Framework.TimerIgnoreAttribute">
            <summary>
            Instructs performance test tool to skip performance test and mark it as a warning information.
            This class cannot be inherited.
            </summary>
            <remarks>Code you are working on sometimes may be not optimized to pass it by performance test, therefore
            you should replace actually marked test attribute with TimerIgnore attribute for this reason.</remarks>
            <example>Mark your class as follows:
            <code>
            // [TimerHitCountTest(20, Unit = Millisecond)] // removed from performance check
            [TimerIgnore("Implementing new algorithm since it's crashing for now")]
            public void QuickSort
            {
            	...
            }
            </code></example>
        </member>
        <member name="F:NTime.Framework.TimerIgnoreAttribute.Info">
            <summary>
            Warning text in performance test tool to indicate that method cannot be checked against perfomance test due to some algorithm problems.
            </summary>
        </member>
        <member name="M:NTime.Framework.TimerIgnoreAttribute.#ctor(System.String)">
            <summary>
            Initializes attribute class to disable performance test and generate warning information.
            </summary>
            <param name="ignoreInfo">Sets warning text in performance test tool to indicate that method cannot be checked against perfomance test due to some algorithm problems.</param>
        </member>
    </members>
</doc>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

AdamSlosarski
Web Developer
Poland Poland
Born in Poland, living there as employeed developer, in free time writing much .net stuff and designing applications.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141223.1 | Last Updated 31 Mar 2006
Article Copyright 2004 by AdamSlosarski
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid