Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Add HTML output to PrettyTable #34

Open
PrzemekWirkus opened this issue Oct 14, 2024 · 0 comments
Open

Add HTML output to PrettyTable #34

PrzemekWirkus opened this issue Oct 14, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@PrzemekWirkus
Copy link
Collaborator

PrzemekWirkus commented Oct 14, 2024

We have PrettyTable class that is responsible for printing text in simple column / rows orientation on the screen. See implementation here:

https://github.com/arm-developer-tools/windowsperf/blob/main/wperf/prettytable.h

We can extend this class to output HTML as HTML has simple format for tables, headers etc.

Example output for WindowsPerf:

wperf stat -m imix -c 0 sleep 3
counting ... done

Performance counter stats for core 0, no multiplexing, kernel mode excluded, on Arm Limited core implementation:
note: 'e' - normal event, 'gN' - grouped event with group number N, metric name will be appended if 'e' or 'g' comes from it

        counter value  event name  event idx  event note
        =============  ==========  =========  ==========
           17,712,516  cycle       fixed      e
           21,095,240  inst_spec   0x1b       g0,imix
            9,646,997  dp_spec     0x73       g0,imix
               90,185  vfp_spec    0x75       g0,imix
              616,871  ase_spec    0x74       g0,imix
            4,249,728  ld_spec     0x70       g0,imix
            2,375,391  st_spec     0x71       g0,imix

               3.293 seconds time elapsed

This part is printed with PrettyTable:

        counter value  event name  event idx  event note
        =============  ==========  =========  ==========
           17,712,516  cycle       fixed      e
           21,095,240  inst_spec   0x1b       g0,imix
            9,646,997  dp_spec     0x73       g0,imix
               90,185  vfp_spec    0x75       g0,imix
              616,871  ase_spec    0x74       g0,imix
            4,249,728  ld_spec     0x70       g0,imix
            2,375,391  st_spec     0x71       g0,imix

We can generate simple HTML using additional code (the same way we generate JSON now), example HTML minimalistic output example: Simple PrettyTable to HTML ($3689086) · Snippets · GitLab

<p>
Performance counter stats for core 0, no multiplexing, kernel mode excluded, on Arm Limited core implementation:
</p>
<p>
note: 'e' - normal event, 'gN' - grouped event with group number N, metric name will be appended if 'e' or 'g' comes from it
</p>

<table cellspacing="6" cellpadding="0">
  <tr>
    <th>counter value</th>
    <th>event name</th>
    <th>event idx</th>
    <th>event note</th>
  </tr>
  <tr>
    <td>17,712,516</td>
    <td>cycle</td>
    <td>fixed</td>
    <td>e</td>
  </tr>
  <tr>
    <td>21,095,240</td>
    <td>inst_spec</td>
    <td>0x1b</td>
    <td>g0,imix</td>
  </tr>
  <tr>
    <td>9,646,997</td>
    <td>dp_spec</td>
    <td>0x73</td>
    <td>g0,imix</td>
  </tr>
</table>

Definition of done

  • Add, in addition to already existing text and JSON, to PrettyTable HTML output.
  • Users will be able to generate reports from counts and save them on disk using --output <filename>.html.
  • Add new command line switch --html to match --json for output format selection.
  • Add proper tests to wperf-scripts.
@PrzemekWirkus PrzemekWirkus added enhancement New feature or request good first issue Good for newcomers labels Oct 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant