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

Print checksum in hexa #55

Closed
jymoulin opened this issue Dec 6, 2012 · 2 comments
Closed

Print checksum in hexa #55

jymoulin opened this issue Dec 6, 2012 · 2 comments

Comments

@jymoulin
Copy link

jymoulin commented Dec 6, 2012

Hi,

percona toolkit usually prints query ID (alias checksum) in hexadecimal in every output (pt-query-digest report, pt-index-usage...etc).

It would be nice to have the checkum printed and searchable in hexa. This will change the checksum field to a fixed size. And this will permit to search in Anemomter with an ID from other percona report.

Thank you !

regards,
jym

@gtowey
Copy link
Contributor

gtowey commented Dec 6, 2012

This is a good idea; I'll try to work on this soon.

@gtowey gtowey closed this as completed in 34525bc Dec 17, 2012
@gtowey
Copy link
Contributor

gtowey commented Dec 17, 2012

This is done.

To add this behavior, you will need to make a modification to your conf/config.inc.php file. See the conf/sample.config.inc.php for reference. At line 410, there's a new part of the report:

'callbacks'     => array(
        'table' => array(
            'checksum' => function ($x) { return array(dec2hex($x), ''); }
        )
    )

dec2hex is a new helper function which will change the field before it is displayed; Callbacks here are a way of applying arbitrary functions to columns in the result set.

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

No branches or pull requests

2 participants