aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/proton_thread_pools_explorer.cpp
blob: 7e94825d3f25cacfa7fa391e3c7c3d739fb48a25 (plain) (blame)
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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "proton_thread_pools_explorer.h"
#include "executor_explorer_utils.h"
#include <vespa/vespalib/data/slime/cursor.h>
#include <vespa/vespalib/util/threadexecutor.h>

using vespalib::ThreadExecutor;

namespace proton {

using explorer::convert_executor_to_slime;

ProtonThreadPoolsExplorer::ProtonThreadPoolsExplorer(const ThreadExecutor* shared,
                                                     const ThreadExecutor* match,
                                                     const ThreadExecutor* docsum,
                                                     const ThreadExecutor* flush,
                                                     const ThreadExecutor* proton,
                                                     const ThreadExecutor* warmup,
                                                     const vespalib::ISequencedTaskExecutor* field_writer)
    : _shared(shared),
      _match(match),
      _docsum(docsum),
      _flush(flush),
      _proton(proton),
      _warmup(warmup),
      _field_writer(field_writer)
{
}

void
ProtonThreadPoolsExplorer::get_state(const vespalib::slime::Inserter& inserter, bool full) const
{
    auto& object = inserter.insertObject();
    if (full) {
        convert_executor_to_slime(_shared, object.setObject("shared"));
        convert_executor_to_slime(_match, object.setObject("match"));
        convert_executor_to_slime(_docsum, object.setObject("docsum"));
        convert_executor_to_slime(_flush, object.setObject("flush"));
        convert_executor_to_slime(_proton, object.setObject("proton"));
        convert_executor_to_slime(_warmup, object.setObject("warmup"));
        convert_executor_to_slime(_field_writer, object.setObject("field_writer"));
    }
}

}