]> git.proxmox.com Git - ceph.git/blob - ceph/src/dmclock/sim/src/test_dmclock.h
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / dmclock / sim / src / test_dmclock.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 /*
5 * Copyright (C) 2016 Red Hat Inc.
6 *
7 * Author: J. Eric Ivancich <ivancich@redhat.com>
8 *
9 * This is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License version
11 * 2.1, as published by the Free Software Foundation. See file
12 * COPYING.
13 */
14
15
16 #include "dmclock_recs.h"
17 #include "dmclock_server.h"
18 #include "dmclock_client.h"
19
20 #include "sim_recs.h"
21 #include "sim_server.h"
22 #include "sim_client.h"
23
24 #include "simulate.h"
25
26
27 namespace crimson {
28 namespace test_dmc {
29
30 namespace dmc = crimson::dmclock;
31 namespace sim = crimson::qos_simulation;
32
33 struct DmcAccum {
34 uint64_t reservation_count = 0;
35 uint64_t proportion_count = 0;
36 };
37
38 using DmcQueue = dmc::PushPriorityQueue<ClientId,sim::TestRequest>;
39 using DmcServiceTracker = dmc::ServiceTracker<ServerId,dmc::OrigTracker>;
40
41 using DmcServer = sim::SimulatedServer<DmcQueue,
42 dmc::ReqParams,
43 dmc::PhaseType,
44 DmcAccum>;
45
46 using DmcClient = sim::SimulatedClient<DmcServiceTracker,
47 dmc::ReqParams,
48 dmc::PhaseType,
49 DmcAccum>;
50
51 using CreateQueueF = std::function<DmcQueue*(DmcQueue::CanHandleRequestFunc,
52 DmcQueue::HandleRequestFunc)>;
53
54 using MySim = sim::Simulation<ServerId,ClientId,DmcServer,DmcClient>;
55
56 using SubmitFunc = DmcClient::SubmitFunc;
57
58 extern void dmc_server_accumulate_f(DmcAccum& a,
59 const dmc::PhaseType& phase);
60
61 extern void dmc_client_accumulate_f(DmcAccum& a,
62 const dmc::PhaseType& phase);
63 } // namespace test_dmc
64 } // namespace crimson