]>
git.proxmox.com Git - ceph.git/blob - 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
5 * Copyright (C) 2016 Red Hat Inc.
7 * Author: J. Eric Ivancich <ivancich@redhat.com>
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
16 #include "dmclock_recs.h"
17 #include "dmclock_server.h"
18 #include "dmclock_client.h"
21 #include "sim_server.h"
22 #include "sim_client.h"
30 namespace dmc
= crimson::dmclock
;
31 namespace sim
= crimson::qos_simulation
;
34 uint64_t reservation_count
= 0;
35 uint64_t proportion_count
= 0;
38 using DmcQueue
= dmc::PushPriorityQueue
<ClientId
,sim::TestRequest
>;
39 using DmcServiceTracker
= dmc::ServiceTracker
<ServerId
,dmc::OrigTracker
>;
41 using DmcServer
= sim::SimulatedServer
<DmcQueue
,
46 using DmcClient
= sim::SimulatedClient
<DmcServiceTracker
,
51 using CreateQueueF
= std::function
<DmcQueue
*(DmcQueue::CanHandleRequestFunc
,
52 DmcQueue::HandleRequestFunc
)>;
54 using MySim
= sim::Simulation
<ServerId
,ClientId
,DmcServer
,DmcClient
>;
56 using SubmitFunc
= DmcClient::SubmitFunc
;
58 extern void dmc_server_accumulate_f(DmcAccum
& a
,
59 const dmc::PhaseType
& phase
);
61 extern void dmc_client_accumulate_f(DmcAccum
& a
,
62 const dmc::PhaseType
& phase
);
63 } // namespace test_dmc
64 } // namespace crimson