You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`cloudkitty_loki_totals_metrics_suffix`|`-loki_metrics_totals.yml`| Suffix for metric totals computed from Loki-retrieved JSON (retrieve_loki_data task). |
49
+
|`cloudkitty_synth_totals_metrics_suffix`|`-synth_metrics_summary.yml`| Suffix for YAML totals from synthetic JSON (`gen_db_summary.py`). |
50
+
|`cloudkitty_loki_totals_suffix`|`-rating.yml`| Suffix for CloudKitty `openstack rating summary` text saved by `loki_rate.yml`. |
51
+
|`cloudkitty_loki_totals_metrics_suffix`|`-loki_metrics_summary.yml`| Suffix for YAML from Loki-retrieved JSON (`gen_db_summary.py` in `retrieve_loki_data.yml`). |
52
52
|`cloudkitty_synth_script`|`{{ role_path }}/files/gen_synth_loki_data.py`| Path to the synthetic data generation script. |
53
53
|`cloudkitty_data_template`|`{{ role_path }}/templates/loki_data_templ.j2`| Path to the Jinja2 template for Loki data format. |
54
54
|`cloudkitty_summary_script`|`{{ role_path }}/files/gen_db_summary.py`| Path to the summary script (gen_db_summary.py). |
@@ -87,13 +87,15 @@ Loki push/query URLs are set dynamically in `setup_loki_env.yml` from the Cloudk
87
87
|`-r`, `--reverse`| Reverse timestamp order in JSON output (youngest first, oldest last). |
88
88
|`--debug`| Enable debug logging. |
89
89
90
-
**gen_synth_loki_metrics_totals.py**— Reads the synthetic (or Loki-retrieved) JSON and writes a YAML with aggregated metrics and time bounds. The output is used by the role for validation and for the Loki query time range.
90
+
**gen_db_summary.py**(`cloudkitty_summary_script`) — This is what the role runs for **both**synthetic totals and Loki-retrieved totals (`gen_synth_loki_data.yml`and `retrieve_loki_data.yml`). It parses Loki-style JSON (streams or `data.result`), sorts entries by timestamp, and writes a single YAML summary used for assertions and for the Loki query window (`time.begin_step.nanosec`).
91
91
92
92
Output YAML structure:
93
93
94
-
***time** — `begin`, `end` (ISO strings), `begin_nano`, `end_nano` (nanosecond timestamps for the first and last time step; used by the Loki query in `retrieve_loki_data.yml`).
***rate** — `by_types` (per-type `Rate`) and `total.Rating`.
97
+
98
+
**gen_synth_loki_metrics_totals.py** — Standalone helper that also reads Loki JSON and emits YAML totals, but with a **different schema** (flat `time` with `begin_nano` / `end_nano`, `data_log.total_time_steps`, and a flat `synth_rate` map including `total_rate`). The role does **not** invoke it; it remains in the repo for manual runs, one-off comparisons, or older workflows. Prefer `gen_db_summary.py` for anything that must match the role’s artifacts and `retrieve_loki_data.yml` expectations.
97
99
98
100
### Dynamically Set Variables
99
101
@@ -109,7 +111,7 @@ Set in **gen_synth_loki_data.yml** for each scenario file during the loop:
109
111
| Variable | Description |
110
112
|----------|-------------|
111
113
|`cloudkitty_data_file`| Local path for generated JSON data (`{{ artifacts_dir_zuul }}/{{ scenario_name }}-synth_data.json`) |
112
-
|`cloudkitty_synth_totals_file`| Local path for calculated metric totals (`{{ artifacts_dir_zuul }}/{{ scenario_name }}{{ cloudkitty_synth_totals_suffix }}`) |
114
+
|`cloudkitty_synth_totals_file`| Local path for calculated metric totals (`{{ artifacts_dir_zuul }}/{{ scenario_name }}{{ cloudkitty_synth_totals_metrics_suffix }}`) |
113
115
|`cloudkitty_test_file`| Path to the scenario configuration file (`{{ cloudkitty_scenario_dir }}/{{ scenario_name }}.yml`) |
0 commit comments