File: report.hpp

package info (click to toggle)
xenium 0.0.2%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,088 kB
  • sloc: cpp: 12,297; makefile: 20
file content (48 lines) | stat: -rw-r--r-- 924 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once

#include <tao/json/value.hpp>
#include <tao/config/value.hpp>

#include <string>
#include <vector>

/*
  {
    name: "bla",
    timestamp: "<epoch>", 
    config: {...},
    rounds: [
      {
        threads: {} | []
        runtime: 10054.736,
        operations: 87324

      }
    ]
  }
*/

struct thread_report {
  // a JSON value containing arbitrary result data for this thread
  tao::json::value data;
  // total number of operations performed by this thread
  std::uint64_t operations;
};

struct round_report {
  std::vector<thread_report> threads;
  double runtime; // runtime in milliseconds
  std::uint64_t operations() const;
  double throughput() const { return operations() / runtime; }

  tao::json::value as_json() const;
};

struct report {
  std::string name;
  std::int64_t timestamp;
  tao::config::value config;
  std::vector<round_report> rounds;

  tao::json::value as_json() const;
};