blob: a0fd3f786a0eeffeb26431c5cc2d4582ea51963a (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "state_reporter_utils.h"
#include <vespa/vespalib/data/slime/cursor.h>
using namespace vespalib::slime;
namespace proton {
void
StateReporterUtils::convertToSlime(const StatusReport &statusReport,
const Inserter &inserter)
{
Cursor &object = inserter.insertObject();
object.setString("state", statusReport.getInternalState());
if (statusReport.hasProgress()) {
object.setDouble("progress", statusReport.getProgress());
}
if (!statusReport.getInternalConfigState().empty()) {
object.setString("configState", statusReport.getInternalConfigState());
}
if (!statusReport.getMessage().empty()) {
object.setString("message", statusReport.getMessage());
}
}
} // namespace proton
|