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

[FEATURE] Perform Data Analytics on Output Generated JSON #8 #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ These modules are extension of core XmlCli API also shows example of how it can
| [Context Menu for Windows OS](src/xmlcli/modules/winContextMenu/README.md) | Installing context menu in windows OS for frequently used APIs |
| [UEFI Binary Parsing](docs/user_guide/uefi_binary_parsing.md) | Parsing UEFI BIOS Binary file as json information, extracting firmware volumes, ffs etc. |
| [Customizing Logging](docs/user_guide/log_configuration.md) | Instruction guide on customizing logging |
| [Data analysis of 2 JSON outputs] (docs/user_guide/analytics.md) | Instructions on performing binary data analysis |

66 changes: 66 additions & 0 deletions docs/user_guide/analytics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Analysing JSON data from 2 different ROM images

## Pie chart and bar graph view of various parameters from 2 JSON files

Following types of views can be seen -

1. Pie chart view of both the images based on file type and section type
2. Bar graph view of each of the parameters of file type and section type to see the comparison in both ROM images

Installation of ```matplotlib``` is a prerequisite.

```python
python -m pip install matplotlib
```


## Seeing Pie charts from 2 different JSON files

Taking 2 JSON files output_1.json and output_2.json as example, we can see the pie chart representation of each of the file types in the following way -

```python
python analytics.py output_1.json output_2.json filetype
```

Similarly, we can see pie chart representation of each of the section types in the following way -

```python
python analytics.py output_1.json output_2.json section
```
![Alt text](filetype_piechart.png?raw=true "pie chart showing file types")

## Seeing Bar graph of various parameters in 2 different JSON files

if we want to compare the count of FV_FILETYPE_DRIVER, we can do it in the following way -

```python
python analytics.py output_1.json output_2.json filetype FV_FILETYPE_DRIVER
```
In the same way, we can compare the count of any section or file type in the 2 JSON files.

We can compare the count of EFI_SECTION_COMPRESSION in the following way -

```python
python analytics.py output_1.json output_2.json section EFI_SECTION_COMPRESSION
```

Currently, the following file types and section types can be seen in the form of bar graph -

```python
python analytics.py output_1.json output_2.json filetype FV_FILETYPE_DRIVER
python analytics.py output_1.json output_2.json filetype FV_FILETYPE_APPLICATION
python analytics.py output_1.json output_2.json filetype FV_FILETYPE_FREEFORM
python analytics.py output_1.json output_2.json filetype FV_FILETYPE_PEIM
python analytics.py output_1.json output_2.json filetype FV_FILETYPE_SMM
python analytics.py output_1.json output_2.json filetype FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
python analytics.py output_1.json output_2.json filetype FV_FILETYPE_RAW

python analytics.py output_1.json output_2.json section EFI_SECTION_COMPRESSION
python analytics.py output_1.json output_2.json section EFI_SECTION_FIRMWARE_VOLUME_IMAGE
python analytics.py output_1.json output_2.json section EFI_SECTION_PEI_DEPEX
python analytics.py output_1.json output_2.json section EFI_SECTION_DXE_DEPEX
python analytics.py output_1.json output_2.json section EFI_SECTION_PE32
python analytics.py output_1.json output_2.json section EFI_SECTION_RAW
```

![Alt text](bar_graph_raw_section.png?raw=true "bar graph showing raw section in 2 JSON files")
Binary file added docs/user_guide/bar_graph_raw_section.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user_guide/filetype_piechart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading