Commit Graph

3 Commits

Author SHA1 Message Date
Amnon Heiman
09fa625672 scripts/get_description.py: param_mapping was missing
get_description.py was moved from a standalone script to a library.
During the transition, param_mapping was not included in the script
option.

This patch makes it possible to use the file as a standalone script
again.
2024-10-18 08:58:04 +03:00
Amnon Heiman
803d414896 get_description.py: Make the Script a library
This patch makes the get_description.py script easier to use by the
documentation automation:
1. The script is now a library.
2. You can choose the output of the script, currently supported pipee
   and yml.

You can still call the from the command line, like before, but you can
also calls it from another python script.

For example the folowing python script would generate the documentation
for the metrics description of the ./alternator/ttl.cc file.
```

import get_description

metrics = get_description.get_metrics_from_file("./alternator/ttl.cc", "scylla", get_description.get_metrics_information("metrics-config.yml"))
get_description.write_metrics_to_file("out.yaml", metrics, "yml")
```

Signed-off-by: Amnon Heiman <amnon@scylladb.com>

Closes scylladb/scylladb#18136
2024-04-02 10:07:11 +03:00
Amnon Heiman
4e67a98a21 Adding scripts/get_description.py to fetch metrics description
The get_description script parse a c++ file and search of metrics
decleration and their description.

It create a pipe delimited file with the metric name, metric family
name,description and location in file.

To find all description in all files:
find . -name "*.cc" -exec grep -l '::description' {} \; | xargs -i ./get_description.py {}

While many of the metrics define in the form of
_metrics.add_group("hints_manager", {
        sm::make_gauge("size_of_hints_in_progress", _stats.size_of_hints_in_progress,
                        sm::description("Size of hinted mutations that are scheduled to be written.")),

Some metrics decleration uses variable and string format.
The script uses a configuration file to translate parameters and
concatenations to the actual names.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2024-02-22 17:06:26 +02:00