Commit aff38112 aff38112dce02a126bec00ef8b1c669471e50328 by Christian Gerdes

Just notes

1 parent 5846546c
Showing 1 changed file with 64 additions and 0 deletions
......@@ -6,3 +6,67 @@ DotNetUtilities.ToX509Certificate((Org.BouncyCastle.X509.X509Certificate)newCert
http://stackoverflow.com/questions/6128541/bouncycastle-privatekey-to-x509certificate2-privatekey
# IDEAS
## Custom Counters
Custom counters can be created directly in the database.
The [LoadTestRunId] is needed, from the current load test run in the
[LoadTestRun] table. This id could be retreived by just getting the latest entry for a ControllerName (since a controller can only run one test at the time).
The question is how to get the datasource connection string.
### Example 1
In this case the counter is created as a counter on the highest (root) level in the results counters, using the [CounterCategoryId] for LoadTest:Scenario
in the [LoadTestPerformanceCounterCategory] table (below it had the value 6).
INSERT INTO [dbo].[LoadTestPerformanceCounter] ([LoadTestRunId], [CounterCategoryId], [CounterId], [CounterName], [HigherIsBetter])
VALUES (4012, 6, 93, N'CustomCounter', 1)
The CounterId here is generated (last +1) and then used in the instance as well:
INSERT INTO [dbo].[LoadTestPerformanceCounterInstance] ([LoadTestRunId], [CounterId], [InstanceId], [LoadTestItemId], [InstanceName], [CumulativeValue], [OverallThresholdRuleResult])
VALUES (4012, 93, 622, NULL, N'Custom', 10, 0)
Here the InstanceId is generated (last +1). InstanceName is the root leef name in the results tree. If the same name as an existing Scenario is used, the counter
is placed in that Scenarios branch. If it doesnt exist, it will be placed by its own in the root (as a new Scenario).
### Example 2
In this case we create a CUSTOM Computer in the Computers root list. It can have it's own categories, counters and instances or counters with a single instance.
INSERT INTO [dbo].[LoadTestPerformanceCounterCategory] ([LoadTestRunId], [CounterCategoryId], [CategoryName], [MachineName], [StartTimeStamp100nSec])
VALUES (4012, 13, N'Test', N'CUSTOM', 131293041616203688)
CounterCategoryId is generated (last +1)
INSERT INTO [dbo].[LoadTestPerformanceCounter] ([LoadTestRunId], [CounterCategoryId], [CounterId], [CounterName], [HigherIsBetter])
VALUES (4012, 13, 92, N'TestCounter', 1)
CounterCategory here is the one created above, CounterId is generated (last +1)
INSERT INTO [dbo].[LoadTestPerformanceCounterInstance] ([LoadTestRunId], [CounterId], [InstanceId], [LoadTestItemId], [InstanceName], [CumulativeValue], [OverallThresholdRuleResult])
VALUES (4012, 92, 621, NULL, N'systemdiagnosticsperfcounterlibsingleinstance', 100, 1)
CounterId from above, InstanceId is generated (last +1), InstanceName is a name for the instance or systemdiagnosticsperfcounterlibsingleinstance as above
CumulativeValue seems to have effect on the graphs max value for the y axis to calculate a range to be used.
### Creating values
Once the counters and instances are set, values (measurements) can be created in the [LoadTestPerformanceCounterSample] table. Below an example for the "User Load" counter
for scenarios:
INSERT INTO [dbo].[LoadTestPerformanceCounterSample] ([LoadTestRunId], [TestRunIntervalId], [InstanceId], [ComputedValue], [RawValue], [BaseValue], [CounterFrequency], [SystemFrequency], [SampleTimeStamp], [SampleTimeStamp100nSec], [CounterType], [ThresholdRuleResult], [ThresholdRuleMessageId])
VALUES (4013, 1, 181, 10, 10, 0, 2636718, 2636718, 39550770, 150000000, 65536, 0, NULL)
INSERT INTO [dbo].[LoadTestPerformanceCounterSample] ([LoadTestRunId], [TestRunIntervalId], [InstanceId], [ComputedValue], [RawValue], [BaseValue], [CounterFrequency], [SystemFrequency], [SampleTimeStamp], [SampleTimeStamp100nSec], [CounterType], [ThresholdRuleResult], [ThresholdRuleMessageId])
VALUES (4013, 2, 181, 10, 10, 0, 2636718, 2636718, 79101540, 300000000, 65536, 0, NULL)
CounterFrequency seems to be set to the same as SystemFrequency and seems to be the local cpu clock frequency.
[CounterType] seems to be the int of the system.diagnostics.performancecountertype enum used, in this case probaly NumberOfItems32
[SampleTimeStamp] seems to be ticks, a multiple of CounterFrequency and the number of seconds of the measurement interval (above 15 seconds)
[SampleTimeStamp100nSec] seems to be the time passed since the beginning of the counter category timestamp in 100nSec (0,1 micro seconds)
......