Skip to content
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

Introduced DataCollectionEntry #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MatousJobanek
Copy link
Collaborator

@MatousJobanek MatousJobanek commented Mar 20, 2017

This is the replacement of TableEntry.
Let's consider the previous data for table entry - the idea is to store every item of the table body as a DataItem in the DataCollectionEntry. Every item also contains a list of labels that brings additional semantic. In our case the labels represent the headers - both row header the column header - this is the reason for the list of labels. Every label may also contain some parent label - a solution for a colspan.

As the new entry contains a list of data items with associated labels it could be quite difficult to parse it. This is the reason why I have introduced a new method for all Entries: outputEntry()

In the case of DataCollectionEntry the method outputEntry() transforms all data items and labels, so the data are sorted and divided by the specified labels.

Unfortunately, there is one open question - if we used this way of transforming DataCollectionEntry then when one DataItem has more labels we need would need to create some hierarchy the labels setting them as parent labels. In other words - which label (first or second one) should be set as parent label of the other one.
Currently, I take the second label and set it as the highest parent label of the first one. Then it take third and set is as highest parent label of the first one (on top of the already added second label) etc... https://github.com/arquillian/arquillian-reporter/compare/master...MatousJobanek:data-structure?expand=1#diff-ef67db943c19836a7a3a82d233c88b8dR52
But I'm not sure if this can be applied in all cases...

The JSON for this table:
network-stats-table
would be:

  {
    "entryName": {
      "value": "Networks statistics"
    },
    "subCollections": [
      {
        "labelName": {
          "value": "Adapter"
        },
        "subCollections": [
          {
            "labelName": {
              "value": "eth0"
            },
            "subCollections": [
              {
                "labelName": {
                  "value": "rx_bytes"
                },
                "subCollections": [
                  {
                    "labelName": {
                      "value": "Before Test"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "258 B"
                          }
                        }
                      }
                    ]
                  },
                  {
                    "labelName": {
                      "value": "After Test"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "258 B"
                          }
                        }
                      }
                    ]
                  },
                  {
                    "labelName": {
                      "value": "Use"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "0 B"
                          }
                        }
                      }
                    ]
                  }
                ],
                "dataList": []
              },
              {
                "labelName": {
                  "value": "tx_bytes"
                },
                "subCollections": [
                  {
                    "labelName": {
                      "value": "Before Test"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "258 B"
                          }
                        }
                      }
                    ]
                  },
                  {
                    "labelName": {
                      "value": "After Test"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "258 B"
                          }
                        }
                      }
                    ]
                  },
                  {
                    "labelName": {
                      "value": "Use"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "0 B"
                          }
                        }
                      }
                    ]
                  }
                ],
                "dataList": []
              }
            ],
            "dataList": []
          },
          {
            "labelName": {
              "value": "Total"
            },
            "subCollections": [
              {
                "labelName": {
                  "value": "rx_bytes"
                },
                "subCollections": [
                  {
                    "labelName": {
                      "value": "Before Test"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "258 B"
                          }
                        }
                      }
                    ]
                  },
                  {
                    "labelName": {
                      "value": "After Test"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "258 B"
                          }
                        }
                      }
                    ]
                  },
                  {
                    "labelName": {
                      "value": "Use"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "0 B"
                          }
                        }
                      }
                    ]
                  }
                ],
                "dataList": []
              },
              {
                "labelName": {
                  "value": "tx_bytes"
                },
                "subCollections": [
                  {
                    "labelName": {
                      "value": "Before Test"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "258 B"
                          }
                        }
                      }
                    ]
                  },
                  {
                    "labelName": {
                      "value": "After Test"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "258 B"
                          }
                        }
                      }
                    ]
                  },
                  {
                    "labelName": {
                      "value": "Use"
                    },
                    "subCollections": [],
                    "dataList": [
                      {
                        "dataValue": {
                          "content": {
                            "value": "0 B"
                          }
                        }
                      }
                    ]
                  }
                ],
                "dataList": []
              }
            ],
            "dataList": []
          }
        ],
        "dataList": []
      }
    ]
  }

@MatousJobanek
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant