mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-14 07:52:34 +00:00
* ci: update Agent and Traces benchmark runtime Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: use unrestricted benchmark runtimes by default Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: retry benchmark image pulls before generating datasets Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: increase tracesbench defaults to 8 CPU and 32 GiB Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: configure tracesbench query timeout and update runtime Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: update tracesbench runtime and configure import scan workers Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: use shared parallel tracesbench import preparation Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: update tracesbench runtime to preserve Tempo trace requests Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: summarize tracesbench query results and lifecycle Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: show benchmark resource usage and update parallel loader runtime Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(ci): resolve shared summary module in existing test harness Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: select tracesbench engines and GreptimeDB image version Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: update benchmark runtime with parallel Agent preparation Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: select benchmark runtime registry by cloud provider Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: retry long-range benchmark image pulls Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: compare baseline and candidate GreptimeDB benchmarks Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: pin published dual-version benchmark runtime Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: prepare agent benchmark indexes with updated runtime Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: validate agent admission and render traces version comparison Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: use runtime with traces index preparation Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: use consolidated runtime for benchmark version reports Signed-off-by: WenyXu <wenymedia@gmail.com> * test: add license header to benchmark comparison tests Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(ci): read legacy Tempo ingestion metrics in traces summaries Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: require tracesbench query plan artifacts Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: use optimized tracesbench report runtime Signed-off-by: WenyXu <wenymedia@gmail.com> * ci: update tracesbench runtime to merged report validation Signed-off-by: WenyXu <wenymedia@gmail.com> --------- Signed-off-by: WenyXu <wenymedia@gmail.com>
55 lines
2.4 KiB
Python
55 lines
2.4 KiB
Python
# Copyright 2023 Greptime Team
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
import importlib.util
|
|
import sys
|
|
import tempfile
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
SCRIPT = Path(__file__).parents[2] / '.github/scripts/tracesbench-summary.py'
|
|
sys.path.insert(0, str(SCRIPT.parent))
|
|
spec = importlib.util.spec_from_file_location('tracesbench_summary', SCRIPT)
|
|
summary = importlib.util.module_from_spec(spec)
|
|
spec.loader.exec_module(summary)
|
|
|
|
|
|
class LifecycleTest(unittest.TestCase):
|
|
def test_ingestion_layouts(self):
|
|
metrics = {'wall_seconds': 0.121723417, 'successful_requests': 17, 'failed_requests': 0}
|
|
cases = [
|
|
(target, {'ingest': metrics}, ['121.7 ms', '17', '0'])
|
|
for target in summary.TARGETS
|
|
] + [
|
|
('tempo', {'transport': {'ingest': metrics}}, ['121.7 ms', '17', '0']),
|
|
('tempo', {'ingest': {'wall_seconds': 0, 'successful_requests': 0, 'failed_requests': 0},
|
|
'transport': {'ingest': metrics}}, ['0 µs', '0', '0']),
|
|
('tempo', {'ingest': {}, 'transport': {'ingest': metrics}}, ['—', '—', '—']),
|
|
('tempo', {'transport': {}}, ['—', '—', '—']),
|
|
] + [(target, {}, ['—', '—', '—']) for target in summary.TARGETS] + [
|
|
(target, {'transport': {'ingest': metrics}}, ['—', '—', '—'])
|
|
for target in ('greptimedb', 'victoriatraces')
|
|
]
|
|
with tempfile.TemporaryDirectory() as tmp:
|
|
for target, load, expected in cases:
|
|
with self.subTest(target=target, load=load):
|
|
text = summary.lifecycle({}, [{'target': target, 'load': load}], Path(tmp), [target])
|
|
row = next(line for line in text.splitlines() if line.startswith('| ' + target + ' |'))
|
|
cells = [cell.strip() for cell in row.split('|')[1:-1]]
|
|
self.assertEqual(cells[4:7], expected)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|