/ proof-of-concept / benchcompress
Sign in
proof-of-concept / benchcompress
benchcompress / benchcompress / src / benchcompress / run_benchmarks / upload_benchmark_status.py
39 lines · 1.4 KBBlameHistoryRaw
1from typing import Any, Dict, List
2import time
3from datetime import datetime
4from ._memobin import (
5 upload_to_memobin,
6)
9def upload_benchmark_status(
10 memobin_api_key: str,
11 current_dataset: str,
12 current_algorithm: str,
13 completed_benchmarks: List[Dict[str, Any]],
14 total_benchmarks: int,
15 start_time: float,
16) -> None:
17 """Upload current benchmark status to memobin.
19 Args:
20 memobin_api_key: API key for memobin authentication
21 current_dataset: Name of the current dataset being processed
22 current_algorithm: Name of the current algorithm being tested
23 completed_benchmarks: List of completed benchmark results
24 total_benchmarks: Total number of benchmarks to run
25 start_time: Timestamp when the benchmark run started
26 """
27 status = {
28 "current_dataset": current_dataset,
29 "current_algorithm": current_algorithm,
30 "completed_count": len(completed_benchmarks),
31 "total_count": total_benchmarks,
32 "progress_percentage": (len(completed_benchmarks) / total_benchmarks) * 100,
33 "elapsed_time": time.time() - start_time,
34 "last_update": datetime.now().isoformat(),
35 "completed_benchmarks": completed_benchmarks,
36 }
38 status_url = "https://tempory.net/f/memobin/benchmark_status/current.json"
39 upload_to_memobin(status, status_url, memobin_api_key)
↑↓ move↵openescclose