-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
etcdctl/check: create new check command for memory usage #9185
Conversation
etcdctl/ctlv3/command/check.go
Outdated
totalAllocAfter := statsAfter.Alloc | ||
diffAlloc := totalAllocAfter - totalAllocBefore | ||
// rounded percent of memory consumed | ||
percentAlloc := (diffAlloc*100)/totalOSMemory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this make sense? Couple of example outputs,
# ./bin/etcdctl check datascale
PASS: Memory usage is optimal. Percent memory used is : 26
PASS
# ./bin/etcdctl check datascale --load="m"
PASS: Memory usage is optimal. Percent memory used is : 38
PASS
I couldn't test "l" yet, I need to increate quota and then test. For now it times out,
# ./bin/etcdctl check datascale --load="l"
Error: etcdserver: request timed out
etcdctl/ctlv3/command/check.go
Outdated
totalAllocAfter := statsAfter.Alloc | ||
diffAlloc := totalAllocAfter - totalAllocBefore | ||
// rounded percent of memory consumed | ||
percentAlloc := (diffAlloc*100) / totalOSMemory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this make sense? Couple of example outputs,
# ./bin/etcdctl check datascale
PASS: Memory usage is optimal. Percent memory used is : 26
PASS
# ./bin/etcdctl check datascale --load="m"
PASS: Memory usage is optimal. Percent memory used is : 38
PASS
I couldn't test "l" yet, I need to increate quota and then test. For now it times out,
# ./bin/etcdctl check datascale --load="l"
Error: etcdserver: request timed out
etcdctl/ctlv3/command/check.go
Outdated
totalAllocAfter := statsAfter.Alloc | ||
diffAlloc := totalAllocAfter - totalAllocBefore | ||
// rounded percent of memory consumed | ||
percentAlloc := (diffAlloc * 100) / totalOSMemory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this make sense? Couple of example outputs,
# ./bin/etcdctl check datascale
PASS: Memory usage is optimal. Percent memory used is : 26
PASS
# ./bin/etcdctl check datascale --load="m"
PASS: Memory usage is optimal. Percent memory used is : 38
PASS
I couldn't test "l" yet, I need to increase quota and then test. For now it times out,
# ./bin/etcdctl check datascale --load="l"
Error: etcdserver: request timed out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the output looks good to me. probably 26% of memory is used, expected less than 60%
is easier to read than the current format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spzala can you try to check why l
times out on your environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I think it's because of my default storage size. "l" takes more than 2 GB. I will be increasing it with --quota-backend-bytes.
Codecov Report
@@ Coverage Diff @@
## master #9185 +/- ##
=========================================
Coverage ? 75.34%
=========================================
Files ? 365
Lines ? 30827
Branches ? 0
=========================================
Hits ? 23227
Misses ? 5975
Partials ? 1625
Continue to review full report at Codecov.
|
ExitWithError(ExitBadFeature, fmt.Errorf("unknown load option %v", checkDatascaleLoad)) | ||
} | ||
cfg := checkDatascaleCfgMap[model] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably we shall print out what to test here.
example output:
start to test small data scale [10000 key-value pairs, 1kb per key-value, 50 concurrent clients]
etcdctl/ctlv3/command/check.go
Outdated
} | ||
|
||
if percentAlloc > 60 { // leaves less than 40 percent of memory | ||
fmt.Println("FAIL: Memory usage is too high. Percent memory used is :", percentAlloc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably print out the expected value (60%).
also how about also print out the absolute memory usage in MB besides the percentage value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 sure. Thanks much! All the comments looks good to me, agree that It's good to provide some more info than less.
Looks great in general. |
@xiang90 Thanks much!! I will be working on your suggestions and update new commit soon. |
etcdctl/ctlv3/command/check.go
Outdated
totalAllocAfter := statsAfter.Alloc | ||
diffAlloc := totalAllocAfter - totalAllocBefore | ||
// rounded percent of memory consumed | ||
percentAlloc := float64((diffAlloc * 100) / totalOSMemory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 Here are couple of sample outputs with the latest changes:
# ./bin/etcdctl check datascale
Start data scale check for work load [10000 key-value pairs, 1024kb per key-value, 50 concurrent clients].
PASS: Memory usage is 25% of available. Expected less than 60%.
INFO: Approx total process memory used : 3mb out of 12mb.
PASS
# ./bin/etcdctl check datascale --load="m"
Start data scale check for work load [100000 key-value pairs, 1024kb per key-value, 200 concurrent clients].
PASS: Memory usage is 22% of available. Expected less than 60%.
INFO: Approx total process memory used : 6mb out of 29mb.
PASS
I couldn't test "large" work load yet due to my VM which limited memory but I believe that's OK for this PR. However, I am in mid of getting bigger machines to set up a 3 node cluster and I will be testing it there. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10000 key-value pairs, 1024kb per key-value
should this be 1024Bytes instead of kb?
INFO: Approx total process memory used : 3mb out of 12mb.
10,000 * 1KB = 10MB data. it looks strange that etcd only consumed 3mb in this case. Probably it is due to there are some pre-allocation happening, and we calculate the delta after the per-allocation. we probably should just report the total usage instead of the delta.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup :), good catch. It's Bytes not kb! OK, agree, let me take a closer look there. Thanks @xiang90 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 you're right. I think using delta as I was didn't make much sense because the total available Sys also changes after put ops. I am going to use total stats.Alloc and stats.Sys after the put operations in newer commit, let's see if that makes sense. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 the newer sample output as in commit 3 looks like below:
# ./bin/etcdctl check datascale
Start data scale check for work load [10000 key-value pairs, 1024 bytes per key-value, 50 concurrent clients].
PASS: Memory usage is 47% of available. Expected less than 60%.
INFO: Approximate total process memory used : 8mb out of 18mb.
PASS
# ./bin/etcdctl check datascale --load="m"
Start data scale check for work load [100000 key-value pairs, 1024 bytes per key-value, 200 concurrent clients].
PASS: Memory usage is 44% of available. Expected less than 60%.
INFO: Approximate total process memory used : 24mb out of 55mb.
PASS
etcdctl/ctlv3/command/check.go
Outdated
clients: 500, | ||
}, | ||
"xl": { | ||
limit: 30000000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 30000000
but not 10000000
? I like the idea of increasing order of limit each time from s -> m -> l -> xl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @fanminshi That's like xxl :-) :-) I think we decided 3000000 considering this is a test and as we go higher in number it can take more time and resource. @xiang90 any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spzala I saw that xl
= 3 * 10^7
and l
= 1 * 10^6
. So i am curious why isn't xl
= 1*10^7
which is one order increase from l
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xl tries to hit the upper bound aggressively which is 3 versions of 1M objects (which is 3M in total).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fanminshi ahhh..sorry I read one more zero in your suggestion and so was kidding with xxl :) Thanks @xiang90 for the explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 make sense. maybe add a comment on xl to explain 3 versions of 1M objects
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fanminshi sure, sounds good. Thanks!
etcdctl/ctlv3/command/check.go
Outdated
} else { | ||
fmt.Println(fmt.Sprintf("PASS: Memory usage is %v%% of available. Expected less than %v%%.", int(percentAlloc), 60)) | ||
} | ||
fmt.Println(fmt.Sprintf("INFO: Approx total process memory used : %vmb out of %vmb.", int(mbUsed), int(mbTotal))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print out this before FAIL/PASS? Also change Approx to Approximate to make the output look more formal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 Agree on using Approximate. On printing it I thought regardless or FAIL/PASS it's a useful message and having FAIL/PASS at very end is more consistent with check perf. So I would keep it if it makes sense to leave as it is or can move it to end? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah. i saw it already prints before PASS/FAIL. I am confused since i also see FAIL/PASS at line 364/367. Probably we can remove the PASS: and FAILED: there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 missed this comment in the latest commit but this sounds good and I am fixing it. Thanks!
I looked at the output again, and believe this is not right. The 18mb is not the total memory of the box, but the total memory go acquired from the box. The 8mb is the allocated (in use) memory of the 18mb memory go acquired from the box. The right way to measure this is (memory acquired from system)/(total memory of the system) which is (18MB/total memory of the system). Probably we need to find a way in go to get the system memory. we can start with just Linux. |
/cc @spzala |
@xiang90 thanks and yes you are right. The |
check out https://github.com/pbnjay/memory? or try /proc/meminfo on linux? |
@xiang90 cool, thanks!! |
@xiang90 it seems straightforward with use of |
@spzala we probably want this command works at least on both linux and osx. just a note if you decide to use syscall. |
@xiang90 OK, sure. Thanks for the heads up! |
@xiang90 with using system memory as a criteria, I guess it looks really good. I could only make it to work on Linux but sample output as an update and for you to take a quick look. Finding osx free memory seems not obvious but going to work on it.
|
based on our dbtest, 1M 1kb keys would consume about 2.1GB memory. However it seems that in your result, 0.1M 1kb keys consumed 1.5GB memory which does not seem right. I do notice that in your setup the kv size is actually 2kb (key=1kb, value=1kb) rather than 1kb in total(we should keep it 1kb though). however, it still does not explain the huge difference between the results. /cc @gyuho can you also take a look of this PR? |
@xiang90 Thanks and it's interesting. I did run 'watch' on memory changes in a separate command line and I could see the usage was pretty accurate when I run the command. But yes you are right, I have 1kb for each key and value, I thought that's what we wanted to do. I will change them 1kb in total. |
@xiang90 After I change kv to total 1kb, I see a good difference but seems like still not similar to what you have mentioned. I will be creating a new commit with latest code for better look. Meanwhile, here is what I see, |
Could you run with 1M keys? Then we can compare with https://github.com/coreos/dbtester/tree/master/test-results/2018Q1-01-etcd#write-1m-keys-256-byte-key-1kb-value-best-throughput-etcd-1k-clients-with-100-conns, which fetches memory usage directly from |
@gyuho thanks and sure! I tried just now with all possible free memory on my ~8gb VM but couldn't run the big workload as it times out. I have got a new machine but needed to set up etcd, so will be getting back on this soon. |
@spzala Also https://github.com/coreos/etcd/tree/master/etcdctl#check-subcommand needs update. Are we measuring the memory usage of etcd + client? Then document that command process needs to be collocated with etcd in the same address space. |
etcdctl/ctlv3/command/check.go
Outdated
wg.Add(len(clients)) | ||
|
||
// get the available system memory before the put operations | ||
systemInfoBefore := &syscall.Sysinfo_t{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. i think i see the problem here:
right now, we are measuring the memory usage of the machine that etcdctl runs on. what we want to measure is the memory usage of the etcd server rather than etcdctl.
probably we should query the etcd metrics endpoint to get the actual etcd server side memory usage instead of the etcdctl one. or we need to tell the user of this command to run etcdctl on the same machine as the etcd server, and only measure the memory usage addition caused by the etcd server.
/cc @gyuho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would be better.
@spzala etcd server metrics exposes process_resident_memory_bytes
. Can you try this out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have any documentation on this metrics (https://github.com/coreos/etcd/blob/master/Documentation/metrics.md), but this is what we recommend to use for monitoring etcd via Prometheus. See example here https://github.com/coreos/etcd/blob/1d99d3886f6cb5fb7ef13100c9587cc01820d38e/Documentation/op-guide/grafana.json#L448-L453
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 @gyuho yes currently I am running server and client on the same machine. @gyuho So to get server side memory usage, are you suggesting to use Prometheus and then look for process_resident_memory_bytes in the metrics? Sorry for the delay, I was out on sick leave and recovering from flu. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find any good reference on process_resident_memory_bytes
on a quick search but at least one place it's mentioned that, "process_resident_memory_bytes is the amount of memory the Prometheus process is using from the kernel."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gyuho a gentle reminder about my question above :-) - I didn't understand how I can test using process_resident_memory_bytes? - are you suggesting to use Prometheus and then look for process_resident_memory_bytes in the metrics? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can query [server-host]:2379/metrics
HTTP endpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks much @gyuho I have just updated new commit. For now, I have hard coded 127.0.0.1 as host but if the overall approach look good, I need some idea on deciding endpoint - should we ask user to provide endpoint? or is there a better way to decide it ourselves? Couple other small things also needed to be done as I have mentioned as review comments. For 1M kv, I got this output which seems looks in-line with @xiang90 earlier mentioned with ~2.x GB consumption. Below are couples of example outputs,
# ./bin/etcdctl check datascale --load="l"
Start data scale check for work load [1000000 key-value pairs, 1024 bytes per key-value, 500 concurrent clients].
INFO: Approximate total system memory used : 2024.46875 MB out of 12 GB.
PASS: Memory usage is 15.565745892195743% of available. Expected less than 60%.
# ./bin/etcdctl check datascale --load="l"
Start data scale check for work load [1000000 key-value pairs, 1024 bytes per key-value, 500 concurrent clients].
INFO: Approximate total system memory used : 2485.078125 MB out of 13 GB.
PASS: Memory usage is 18.482729928669876% of available. Expected less than 60%.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need some idea on deciding endpoint - should we ask user to provide endpoint?
You can get endpoints from etcdctl --endpoints
flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gyuho thanks, true but that's only if user provides it right? so that means we will use first endpint if provided --endpoints
with etcdctl check database
and if ```endpoints`` flag is not provided then we use 127.0.0.1?
etcdctl/ctlv3/command/check.go
Outdated
|
||
// get the available system memory after the put operations | ||
systemInfoAfter := &syscall.Sysinfo_t{} | ||
sysErrAfter := syscall.Sysinfo(systemInfoAfter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we aren't going to use this approach but I noticed that this should have called before Delete ops above.
etcdctl/ctlv3/command/check.go
Outdated
os.Exit(ExitError) | ||
} | ||
} | ||
|
||
// get the process_resident_memory_bytes from <server:2379>/metrics | ||
func processMemoryResidentBytes(host string) float64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this func looks good, I guess we should have it as util function to be reused ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we can put it in util.go
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Thanks @gyuho
etcdctl/ctlv3/command/check.go
Outdated
|
||
// get the available system memory before the put operations | ||
systemInfoBefore := &syscall.Sysinfo_t{} | ||
sysErrBefore := syscall.Sysinfo(systemInfoBefore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syscall is breaking build because it works on Linux only. I know we need to run these code on Linux and OSX so I will be working it and updating a new commit. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can define this with build tags, and let other OS just return dummy values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we still need as we get the server process memory usage from metrics endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 that's a good question, so far I have used endpoint to get the memory in use (process_resident_memory_bytes) but we also need total available memory to compare the percentage consumption. I am checking if endpoint metrics also returns that value, and if so you are right we don't need to use syscall. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 @gyuho so for the purpose of comparing the difference of process_resident_memory_bytes
before and after kv insert to the actual available system memory, can I rely on process_virtual_memory_bytes
? (I don't see the process_virtual_memory_bytes
same as what I get with syscall.Sysinfo
on my VM but I am not sure if we use process_virtual_memory_bytes
for monitoring in any way and unfortunately I couldn't much info on it.) Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, might be a dumb question but when when I get endpoint metrics on a mac why don't I see the similar output as linux i.e. on mac I don't get process_virtual_memory_bytes
, is that a normal behavior or am I missing something? Thanks!
cc8bf1a
to
d5dd233
Compare
@xiang90 @gyuho I am now using endpoint metrics for everything and processes user provided endpoint if any or localhost. Please take a look. Here are updated output examples:
|
|
||
// delete the created kv pairs | ||
ctx, cancel = context.WithCancel(context.Background()) | ||
_, err = clients[0].Delete(ctx, checkDatascalePrefix, v3.WithPrefix()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing that I could not fully test was with large workload i.e. with option --load="l"
. In that case, I had to comment the Delete
because by deleting eventually ran into context deadline exceeded
. But I hope my testing is still OK as after commenting LOC 259 to 364 I could run the command fine as I provided in the example in my another comment. I guess it's my VM because after running --load="l"
I have to compact and defrag to continue using etcd. Thanks!
etcdctl/ctlv3/command/util.go
Outdated
if strings.HasPrefix(line, `process_resident_memory_bytes`) { | ||
residentMemory = strings.TrimSpace(strings.TrimPrefix(line, `process_resident_memory_bytes`)) | ||
} | ||
if strings.HasPrefix(line, `process_virtual_memory_bytes`) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
virtual memory is not the total available memory on the host. i guess we need to modify etcd server to make it report the total available memory on host.
how about just keeping the percentage calculation as a todo, and simply reporting the memory usage and outputting pass always?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiang90 sure, thanks. That sounds a great approach !! (I have a new go func created for darwin to find available memory using vm_stat (hw.physmem is not reliable at all) and one on Linux with syscall, not sure if we can use that for our todo or on server side but as you suggested let's take that separately for a concise and clear discussion on it's own). Thanks!
@xiang90 I have updated new commit and modified help text little bit to reflect our approach. If it look good, I will be creating doc separately to modify etcdctl readme. Hope that's OK. Thanks! |
Sample outputs:
|
we might want to add a progress bar to track the testing progress. lgtm in general. defer to @gyuho for a final code review. |
etcdctl/ctlv3/command/check.go
Outdated
fmt.Printf("FAIL: ERROR(%v) -> %d\n", k, v) | ||
} | ||
ok = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move if ok { ... }
here? ok
is basically same as len(s.ErrorDist) == 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gyuho sure, good point. Thanks!
3e0eb42
to
3b7333f
Compare
@spzala Just rebase from latest commit in your master branch. And squash them all? |
Create a new command similar to check perf that can check the memory consumption for putting different workloads on a given endpoint. If no endpoint is provided, localhost will be used. Return user with a message that whether there are enough memory for a given workload with pass or fail. Fixed etcd-io#9121
3b7333f
to
53d2a2e
Compare
Thanks @gyuho squashed. |
@gyuho can we please have this in now if it looks good? so that I can start working on top of it? Thanks!! |
@spzala Let's add auto compact, auto defrag options in a separate PR? Thanks! |
@gyuho thanks and yup, I will have a PR soon on it. |
Create a new command similar to check perf that can check the memory
consumption for putting different workloads. Return user with a message
that whether there are enough memory for a given workload with pass
or fail.
Fixed #9121
Contributing guidelines
Please read our contribution workflow before submitting a pull request.