server icon indicating copy to clipboard operation
server copied to clipboard

MDEV-34953 Add JSON flag for `mysqldumpslow.sh` output

Open HNOONa-0 opened this issue 8 months ago • 9 comments
trafficstars

  • [x] The Jira issue number for this PR is: MDEV-34953

Description

The mysqldumpslow.sh script outputs data as a string. This change introduces a --json flag to format the output as JSON for better structure.

Release Notes

Added a --json flag to mysqldumpslow.sh, enabling JSON-formatted output for improved integration with tools that process structured JSON data.

How can this PR be tested?

It can be manually tested on any *-slow.log file. You can provide the filepath as an argument. Here is a video showing how it works:

https://github.com/user-attachments/assets/a2bab163-b3da-452e-8e9b-1ee72555ff06

The problem is that I had to download the JSON module on my machine to encode the data as JSON, how do i make it preinstalled on other machines so that it works out right away for other users?

Basing the PR against the correct MariaDB version

  • [x] This is a new feature or a refactoring, and the PR is based against the main branch.
  • [ ] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • [x] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • [ ] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

HNOONa-0 avatar Mar 20 '25 10:03 HNOONa-0