-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add measurement recipe run export to JSON #322
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm a bit unsure about the class names here. Feel free to provide any suggestions. |
Kuba314
force-pushed
the
recipe-run-export
branch
from
August 22, 2023 18:13
5e17083
to
ba08ecd
Compare
@olichtne Changed the format a bit and also format every result, not just measurement results. New JSON format[
{
"type": "device_method_call",
"host": "host1",
"netns": "",
"dev_id": "eth0",
"method": {
"name": "ip_add",
"args": [
"Ip4Address(192.168.101.1/24)"
],
"kwargs": []
}
},
{
"type": "device_method_call",
"host": "host1",
"netns": "",
"dev_id": "eth0",
"method": {
"name": "ip_add",
"args": [
"Ip6Address(fc00::1/64)"
],
"kwargs": []
}
},
{
"type": "device_method_call",
"host": "host1",
"netns": "",
"dev_id": "eth0",
"method": {
"name": "up_and_wait",
"args": [],
"kwargs": []
}
},
{
"type": "device_method_call",
"host": "host2",
"netns": "",
"dev_id": "eth0",
"method": {
"name": "ip_add",
"args": [
"Ip4Address(192.168.101.2/24)"
],
"kwargs": []
}
},
{
"type": "device_method_call",
"host": "host2",
"netns": "",
"dev_id": "eth0",
"method": {
"name": "ip_add",
"args": [
"Ip6Address(fc00::2/64)"
],
"kwargs": []
}
},
{
"type": "device_method_call",
"host": "host2",
"netns": "",
"dev_id": "eth0",
"method": {
"name": "up_and_wait",
"args": [],
"kwargs": []
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "ethtool -K eth1 gro on gso on rx on tso on tx on"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "ethtool -K eth1 gro on gso on rx on tso on tx on"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "ethtool -K eth1 gro on gso on rx on tso on tx on"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "ethtool -K eth1 gro on gso on rx on tso on tx on"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "service irqbalance stop"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "service irqbalance stop"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "service irqbalance stop"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "service irqbalance stop"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "lscpu"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "lscpu"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "grep -P \"eth1\" /proc/interrupts | cut -f1 -d: | sed 's/ //'"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "grep -P \"eth1\" /proc/interrupts | cut -f1 -d: | sed 's/ //'"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "lscpu"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "lscpu"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "grep -P \"eth1\" /proc/interrupts | cut -f1 -d: | sed 's/ //'"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "grep -P \"eth1\" /proc/interrupts | cut -f1 -d: | sed 's/ //'"
}
},
{
"type": "device_method_call",
"host": "host1",
"netns": "",
"dev_id": "eth0",
"method": {
"name": "ips_filter",
"args": [],
"kwargs": [
"family=<AddressFamily.AF_INET: 2>"
]
}
},
{
"type": "device_method_call",
"host": "host2",
"netns": "",
"dev_id": "eth0",
"method": {
"name": "ips_filter",
"args": [],
"kwargs": [
"family=<AddressFamily.AF_INET: 2>"
]
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "module",
"repr": "Ping(dst=Ip4Address(192.168.101.2/24), interface=Ip4Address(192.168.101.1/24), count=30, interval=0.2, size=56)"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "module",
"repr": "Ping(dst=Ip4Address(192.168.101.2/24), interface=Ip4Address(192.168.101.1/24), count=30, interval=0.2, size=56)"
}
},
{
"type": "measurement",
"measurement_type": "ping",
"data": {
"trans_pkts": "30",
"recv_pkts": "30",
"rate": 100,
"rtt_min": 0.023,
"rtt_max": 0.098,
"rtt_avg": 0.058,
"rtt_mdev": 0.019
}
},
{
"type": "device_method_call",
"host": "host1",
"netns": "",
"dev_id": "eth0",
"method": {
"name": "ips_filter",
"args": [],
"kwargs": [
"family=<AddressFamily.AF_INET: 2>"
]
}
},
{
"type": "device_method_call",
"host": "host2",
"netns": "",
"dev_id": "eth0",
"method": {
"name": "ips_filter",
"args": [],
"kwargs": [
"family=<AddressFamily.AF_INET: 2>"
]
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "module",
"repr": "CPUStatMonitor(interval=1000)"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "module",
"repr": "CPUStatMonitor(interval=1000)"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "module",
"repr": "IperfServer(bind=Ip4Address(192.168.101.2/24), oneoff=True, cpu_bind=[1], port=12000)"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "module",
"repr": "IperfClient(server=Ip4Address(192.168.101.2/24), duration=10, warmup_duration=0, cpu_bind=[1], blksize=123, port=12000, client_port=12000)"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "module",
"repr": "IperfServer(bind=Ip4Address(192.168.101.2/24), oneoff=True, cpu_bind=[1], port=12000)"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "module",
"repr": "IperfClient(server=Ip4Address(192.168.101.2/24), duration=10, warmup_duration=0, cpu_bind=[1], blksize=123, port=12000, client_port=12000)"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "module",
"repr": "CPUStatMonitor(interval=1000)"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "module",
"repr": "CPUStatMonitor(interval=1000)"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "module",
"repr": "CPUStatMonitor(interval=1000)"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "module",
"repr": "CPUStatMonitor(interval=1000)"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "module",
"repr": "IperfServer(bind=Ip4Address(192.168.101.2/24), oneoff=True, cpu_bind=[1], port=12000)"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "module",
"repr": "IperfClient(server=Ip4Address(192.168.101.2/24), duration=10, warmup_duration=0, cpu_bind=[1], blksize=123, port=12000, client_port=12000)"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "module",
"repr": "IperfServer(bind=Ip4Address(192.168.101.2/24), oneoff=True, cpu_bind=[1], port=12000)"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "module",
"repr": "IperfClient(server=Ip4Address(192.168.101.2/24), duration=10, warmup_duration=0, cpu_bind=[1], blksize=123, port=12000, client_port=12000)"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "module",
"repr": "CPUStatMonitor(interval=1000)"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "module",
"repr": "CPUStatMonitor(interval=1000)"
}
},
{
"type": "measurement",
"measurement_type": "cpu",
"data": {
"utilization": 141.9735541344335
}
},
{
"type": "measurement",
"measurement_type": "cpu",
"data": {
"utilization": 142.29364231769054
}
},
{
"type": "measurement",
"measurement_type": "flow",
"data": {
"generator_results": 112951335.22424692,
"generator_cpu_stats": 38.26131813885169,
"receiver_results": 112497825.88070199,
"receiver_cpu_stats": 31.39989038805761
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "service irqbalance start"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "service irqbalance start"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "service irqbalance start"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "service irqbalance start"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "ethtool -K eth1 gro on gso on rx on tso on tx on"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "ethtool -K eth1 gro on gso on rx on tso on tx on"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "ethtool -K eth1 gro on gso on rx on tso on tx on"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "ethtool -K eth1 gro on gso on rx on tso on tx on"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "cpupower idle-set -E"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "cpupower idle-set -E"
}
},
{
"type": "job",
"action": "start",
"job": {
"type": "shell",
"command": "cpupower idle-set -E"
}
},
{
"type": "job",
"action": "end",
"job": {
"type": "shell",
"command": "cpupower idle-set -E"
}
}
] |
olichtne
requested changes
Aug 23, 2023
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.
looks ok to me except the two minor comments.
There will be more run summary formatters coming.
Former RunSummaryFormatter has been renamed to ImportantRunSummaryFormatter.
This RecipeResult descendant should be used to signal that a measurement has finished and has results. This should be always a `ResultType.PASS`. `tc` would use `ResultType.FAIL` in case of a failure but still provided some data, which it probably shouldn't be doing.
Kuba314
force-pushed
the
recipe-run-export
branch
from
August 29, 2023 13:41
ba08ecd
to
162eea8
Compare
olichtne
approved these changes
Aug 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a new
RecipeRunFormatter
capable of exporting just measurement results into JSON. Example of what the output might looks like:JSON
Tests
Tested locally with a custom runner printing the JSON-formatted summary.
Reviews
@LNST-project/lnst-developers
Closes: #320