summaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/executor_threading_service_explorer.cpp
blob: 5bbbf1ca57d5653d3380f1b90f3ceae9dda5a7f9 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "executor_explorer_utils.h"
#include "executor_threading_service_explorer.h"
#include "executorthreadingservice.h"
#include <vespa/vespalib/data/slime/cursor.h>

namespace proton {

using explorer::convert_executor_to_slime;

ExecutorThreadingServiceExplorer::ExecutorThreadingServiceExplorer(searchcorespi::index::IThreadingService& service)
    : _service(service)
{
}

ExecutorThreadingServiceExplorer::~ExecutorThreadingServiceExplorer() = default;

void
ExecutorThreadingServiceExplorer::get_state(const vespalib::slime::Inserter& inserter, bool full) const
{
    auto& object = inserter.insertObject();
    if (full) {
        convert_executor_to_slime(&_service.master(), object.setObject("master"));
        convert_executor_to_slime(&_service.index(), object.setObject("index"));
        convert_executor_to_slime(&_service.summary(), object.setObject("summary"));
        convert_executor_to_slime(&_service.indexFieldInverter(), object.setObject("index_field_inverter"));
        convert_executor_to_slime(&_service.indexFieldWriter(), object.setObject("index_field_writer"));
        convert_executor_to_slime(&_service.attributeFieldWriter(), object.setObject("attribute_field_writer"));
    }
}

}