Seastar
High performance C++ framework for concurrent servers
stall_sampler.hh
1/*
2 * Copyright (C) 2018 ScyllaDB
3 */
4
5/*
6 * This file is open source software, licensed to you under the terms
7 * of the Apache License, Version 2.0 (the "License"). See the NOTICE file
8 * distributed with this work for additional information regarding copyright
9 * ownership. You may not use this file except in compliance with the License.
10 *
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
20 * under the License.
21 */
22
23#pragma once
24
25#include <seastar/core/future.hh>
26#include <seastar/util/noncopyable_function.hh>
27
28#include <iosfwd>
29
30// Instrumentation to detect context switches during reactor execution
31// and associated stall time, intended for use in tests
32
33namespace seastar {
34
35namespace internal {
36
37struct stall_report {
38 uint64_t kernel_stalls;
39 sched_clock::duration run_wall_time; // excludes sleeps
40 sched_clock::duration stall_time;
41};
42
45future<stall_report> report_reactor_stalls(noncopyable_function<future<> ()> uut);
46
47std::ostream& operator<<(std::ostream& os, const stall_report& sr);
48
49}
50
51}
52
Seastar API namespace.
Definition: abort_on_ebadf.hh:26