blob: 131b31a74ebdb1bf8a904454ee0304d1b923fc3e (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "hw_info_explorer.h"
#include <vespa/vespalib/data/slime/cursor.h>
namespace proton {
HwInfoExplorer::HwInfoExplorer(const HwInfo& info)
: _info(info)
{
}
void
HwInfoExplorer::get_state(const vespalib::slime::Inserter& inserter, bool full) const
{
auto& object = inserter.insertObject();
if (full) {
auto& disk = object.setObject("disk");
disk.setLong("size_bytes", _info.disk().sizeBytes());
disk.setBool("slow", _info.disk().slow());
disk.setBool("shared", _info.disk().shared());
auto& memory = object.setObject("memory");
memory.setLong("size_bytes", _info.memory().sizeBytes());
auto& cpu = object.setObject("cpu");
cpu.setLong("cores", _info.cpu().cores());
}
}
}
|