Add-TestData
The Add-TestData PowerShell cmdlet allows users to efficiently add random test data to the cache for performance testing, verification, and simulation. By adding configurable key-value pairs with absolute expiration (default 300 seconds), this tool is ideal for cache startups, load testing, and benchmarking. Users can customize the number of items, data size, and expiration time to meet specific testing needs. It supports single or multiple servers and secure authentication, ensuring flexible integration and reliable performance checks.
Add-TestData -CacheName [-Server] [-ItemCount] [-DataSize] [-AbsoluteExpiration] [-NoLogo] [-Credentials]
Examples
- This command adds 10 items (it is set to 10 by default) to the demoCache with an expiry of 5 minutes.
Add-TestData –CacheName demoCache
- This command adds 100 items to the demoCache with an expiry of 5 minutes.
Add-TestData -CacheName demoCache -ItemCount 100
- This command adds 100 items of size 2KB to the demoCache with an expiry of 5 minutes.
Add-TestData -CacheName demoCache -ItemCount 100 -DataSize 2048
- This command adds 100 items to the demoCache with an expiry of 5 minutes.
Add-TestData -CacheName demoCache -ItemCount 100 -Server "20.200.20.11,20.200.20.12"
- This command adds 10 items (it is set to 10 by default) to the demoCache with an expiry of 5 minutes, using security credentials.
Add-TestData –CacheName demoCache -Credentials(Get-Credential john_smith)
Properties
Note
The parameters with asterisk (*) on their names are the required parameters and the rest are optional.
| Parameters | Data Types | Description | Default Value |
|---|---|---|---|
-CacheName* |
<String> |
Specifies the name of the cache to which test data will be added. Note: The cache must already exist on the source server. |
- |
-Server |
<String> |
Specifies a server name where the NCache Service is running and a cache with the specified cache-name is registered. You can also specify one or more ip-address(es) for one or more cache-server(s) to customize the list of ip-address(es) to be displayed. Note: Comma separated ip-addresses are to be specified in case of multiple servers inside double quotes. |
IP of local machine |
-ItemCount |
<Long> |
Specifies the number of test items to be added to the cache. | 10 |
-DataSize |
<Long> |
Specifies the size of each item to be added to the cache. | 1024 bytes |
-AbsoluteExpiration |
<Double> |
Specifies the time in seconds for the Absolute expiration of the test data items. Its minimum value is 15 seconds. | 300 seconds |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | False |
-Credentials |
<pscredential> |
Specifies the user credentials required to authorize access for the specified operation. These credentials should belong to a user with the appropriate permissions at the node. | - |