]> git.proxmox.com Git - ceph.git/blob - ceph/src/dmclock/src/dmclock_util.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / dmclock / src / dmclock_util.cc
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) 2017 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 <signal.h>
17
18 #include <iomanip>
19 #include <sstream>
20
21 #include "dmclock_util.h"
22
23
24 std::string crimson::dmclock::format_time(const Time& time, uint modulo) {
25 long subtract = long(time / modulo) * modulo;
26 std::stringstream ss;
27 ss << std::fixed << std::setprecision(4) << (time - subtract);
28 return ss.str();
29 }
30
31
32 void crimson::dmclock::debugger() {
33 raise(SIGCONT);
34 }