Add log loss benchmark framework#630
Conversation
Signed-off-by: Wesley Pettit <wppttt@amazon.com>
| expectedTimeElapsed += cycleTimeInMs; | ||
| actualTimeElapsed = endSeconds - loggingStart; | ||
|
|
||
| if (actualTimeElapsed < expectedTimeElapsed) |
There was a problem hiding this comment.
There is a reason to recheck that we are under our total messages sent here, to avoid the wait of we have already sent all messages
There was a problem hiding this comment.
Yea but then the total runtime won't be correct... sicne we won't wait after the last cycle and then the calculation of the real throughput won't be correct.
There was a problem hiding this comment.
I tested this a bunch last night and the current state gives the right real throughput
matthewfala
left a comment
There was a problem hiding this comment.
Left a minor comment on some of the input validation logic. The core code looks good!
| if (burst_enabled != NULL) { | ||
| burstSizeInMB = atoi(burst_enabled); | ||
| burstThroughputInKb = atoi(getenv("BURST_THROUGHPUT_IN_KB")); | ||
| if ((burstSizeInMB * 2) > totalSizeInKb) { |
There was a problem hiding this comment.
Did you mean totalSizeInMb, this says totalSizeInKb
There was a problem hiding this comment.
or maybe burstSizeInMB * 1000 * 2
There was a problem hiding this comment.
oops, I thought I had remembered this
| burstSizeInMB = atoi(burst_enabled); | ||
| burstThroughputInKb = atoi(getenv("BURST_THROUGHPUT_IN_KB")); | ||
| if ((burstSizeInMB * 2) > totalSizeInKb) { | ||
| printf("ERROR: BURST_SIZE_IN_MB must be less than half of TOTAL_SIZE_IN_MB"); |
There was a problem hiding this comment.
The condition doesn't check what this print statement says. The print statement should say:
ERROR: BURST_SIZE_IN_MB must be greater than half of TOTAL_SIZE_IN_KB
There was a problem hiding this comment.
oh oops my math is wrong
| burstDelayMessages = (burstDelayInMB * 1000) / sizeInKb; | ||
| burstMessagesPerCycle = (burstThroughputInKb * cycleTimeInS) / sizeInKb; |
There was a problem hiding this comment.
This works.
Dimensional analysis
mb * (kb/mb) / (kb/log) = log -- Number of logs per burst delay
(kb/s) * (s) / (kb/log) = log -- Number of logs to output per burst
Signed-off-by: Wesley Pettit <wppttt@amazon.com>
fa542c2 to
921626f
Compare
Signed-off-by: Wesley Pettit <wppttt@amazon.com>
Signed-off-by: Wesley Pettit <wppttt@amazon.com>
Signed-off-by: Wesley Pettit <wppttt@amazon.com>
matthewfala
left a comment
There was a problem hiding this comment.
Thank you, Wesley! I took a look and this looks good! I like how you make use of ECS metadata to get a hold of the correct log stream in the validator. That's really cool, and impressive that it works.
|
|
||
| func main() { | ||
| runningInECS := false | ||
| if (os.Getenv("ECS_CONTAINER_METADATA_URI_V4") != "") { |
| // First 8 char is the unique record ID | ||
| recordId := log[:8] | ||
| cwRecoredCounter += 1 | ||
| if _, ok := inputMap[recordId]; ok { |
There was a problem hiding this comment.
Just a note: if you run a 10mbps test for 1 day this map would be 6.91200GB if my math is correct:
10000 logs/seconds * 8 bytes/log * 86400 seconds = 6.912Gb. If you see oom kill it may be because of this map.
There was a problem hiding this comment.
this is part of why each test run only sends a few hundred MB of data and runs for only a few minutes
| // output is comma delimited, output insights query result as CSV | ||
| // simple python code can parse the CSV | ||
| fmt.Printf("%s %s - %s, percent lost, %d, number_lost, %d, total_input_record, %d, duplicates, %d, group=%s stream=%s TOTAL_SIZE_IN_MB=%s, SIZE_IN_MB=%s, THROUGHPUT_IN_KB=%s, %s, %s, %s, %s, %s", | ||
| testName, hasLogLoss, throughputInKB, (totalInputRecord-uniqueRecordFound)*100/totalInputRecord, totalInputRecord-uniqueRecordFound, totalInputRecord, totalRecordFound - uniqueRecordFound, |
There was a problem hiding this comment.
I should've put the buffer size in it, but oh well, thats in the test name right now
| burstSizeInMB = atoi(burst_enabled); | ||
| burstThroughputInKb = atoi(getenv("BURST_THROUGHPUT_IN_KB")); | ||
| if ((burstSizeInMB * 2) > totalSizeInKb) { | ||
| printf("ERROR: BURST_SIZE_IN_MB must be less than half of TOTAL_SIZE_IN_MB"); |
|
Closing in favor of: #670 |
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.