Source JSON Structure:
{
"working": {
"https://site.number.one": [
{
"metric": "html",
"type": "requests",
"value": 1,
"friendlyValue": 1,
"limit": 1,
"friendlyLimit": 1,
"limitType": "max",
"status": "working"
},
{
"metric": "html",
"type": "transferSize",
"value": 10662,
"friendlyValue": "10.4 KB",
"limit": 20000,
"friendlyLimit": "19.5 KB",
"limitType": "max",
"status": "working"
}
],
"https://site.number.two": [
{
"metric": "html",
"type": "requests",
"value": 1,
"friendlyValue": 1,
"limit": 1,
"friendlyLimit": 1,
"limitType": "max",
"status": "working"
},
{
"metric": "html",
"type": "transferSize",
"value": 10662,
"friendlyValue": "10.4 KB",
"limit": 20000,
"friendlyLimit": "19.5 KB",
"limitType": "max",
"status": "working"
}
]
},
"failing": {
"https://site.number.two": [
{
"metric": "firstPaint",
"type": "timings",
"value": 1392,
"friendlyValue": "1.392 s",
"limit": 1000,
"friendlyLimit": "1.000 s",
"limitType": "max",
"status": "failing"
}
],
"https://site.number.four": [
{
"metric": "firstPaint",
"type": "timings",
"value": 1665,
"friendlyValue": "1.665 s",
"limit": 1000,
"friendlyLimit": "1.000 s",
"limitType": "max",
"status": "failing"
}
]
}
}
So basically there's two root-level arrays ("working" and "failing") and then within each of those, there is a "site/url" and then within each "url" there's an array of metrics/values etc.
What i'm trying to do, is parse out the URLs (sites), and then their related metrics for comparison/charting etc. I can't figure out what the right combination of spath / field extraction / etc is, so i can chart things like the "html" size as it relates to the "firstPaint" metric. There are hundreds of other metrics, but i just pulled out a few in that source JSON as an example.
Ideally what i'm left with after the parsing, is an ability to work with these fields: Site, metric name, value, status. If i can figure that out, im sure i can expand the logic to include the other fields as needed.
Hopefully i've explained this well enough to describe what i'm trying to do.
... View more