зеркало из https://github.com/microsoft/CCF.git
Add other MC stats (#5817)
This commit is contained in:
Родитель
6e0f67501f
Коммит
99767c7391
|
@ -33,11 +33,9 @@ jobs:
|
|||
|
||||
- script: |
|
||||
set -ex
|
||||
python3.8 -m venv env
|
||||
source env/bin/activate
|
||||
python -m pip install -r requirements.txt
|
||||
ls ../tla/*.json
|
||||
python3 upload_tlc_stats.py 3node_fixed ../tla/MCccfraft_stats.json
|
||||
./cimetrics_env.sh python upload_tlc_stats.py 3node_fixed ../tla/MCccfraft_stats.json
|
||||
./cimetrics_env.sh python upload_tlc_stats.py atomic_reconfig ../tla/MCccfraftAtomicReconfig_stats.json
|
||||
./cimetrics_env.sh python upload_tlc_stats.py reconfig ../tla/MCccfraftWithReconfig_stats.json
|
||||
env:
|
||||
METRICS_MONGO_CONNECTION: $(METRICS_MONGO_CONNECTION)
|
||||
workingDirectory: tests
|
||||
|
|
|
@ -6,8 +6,6 @@ import os
|
|||
import argparse
|
||||
import cimetrics.upload
|
||||
|
||||
from loguru import logger as LOG
|
||||
|
||||
|
||||
def run(test_label, filename):
|
||||
if os.path.exists(filename):
|
||||
|
@ -15,18 +13,15 @@ def run(test_label, filename):
|
|||
data = json.load(f)
|
||||
duration_sec = data["duration"]
|
||||
dstates = data["distinct"]
|
||||
LOG.info(
|
||||
"Uploading metrics for {} - duration: {}, distinct states: {}",
|
||||
test_label,
|
||||
duration_sec,
|
||||
dstates,
|
||||
print(
|
||||
f"Uploading metrics for {test_label} - duration: {duration_sec}, distinct states: {dstates}"
|
||||
)
|
||||
with cimetrics.upload.metrics(complete=False) as metrics:
|
||||
metrics.put(f"tlc_{test_label}_duration_s", duration_sec)
|
||||
metrics.put(f"tlc_{test_label}_states", dstates)
|
||||
|
||||
else:
|
||||
LOG.warning(f"Could not find file {filename}: skipping metrics upload")
|
||||
print(f"Could not find file {filename}: skipping metrics upload")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Загрузка…
Ссылка в новой задаче