MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / upload

Function upload

benchmarks/sw_upload.py:33–56  ·  view source on GitHub ↗
(
    database_path: Path = typer.Argument(..., exists=True),
    token: str = typer.Option(...),
)

Source from the content-addressed store, hash-verified

31
32@app.command()
33def upload(
34 database_path: Path = typer.Argument(..., exists=True),
35 token: str = typer.Option(...),
36):
37 client = Client("https://snailwatch.it4i.cz/api", token)
38 database = load_database(database_path)
39 measurements = []
40
41 for record in database.records:
42 timestamp = datetime.fromtimestamp(record.timestamp)
43 measurement = Measurement(
44 benchmark=record.workload,
45 environment=dict(
46 **normalize_dict(record.workload_params, "workload"),
47 **normalize_dict(record.environment_params, "env"),
48 env=record.environment_params,
49 **normalize_dict(record.benchmark_metadata, "metadata"),
50 ),
51 result=dict(duration=dict(type="time", value=record.duration)),
52 timestamp=timestamp,
53 )
54 measurements.append(measurement)
55
56 client.upload_measurements(measurements)
57
58
59if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

ClientClass · 0.90
normalize_dictFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected