}
public static void toProtobuf(NodeStats stats, ProtobufSystemInfo.Section.Builder protobuf) {
+ setAttribute(protobuf, "CPU Usage (%)", stats.getProcess().getCpu().getPercent());
setAttribute(protobuf, "Disk Available", byteCountToDisplaySize(stats.getFs().getTotal().getAvailable().getBytes()));
setAttribute(protobuf, "Store Size", byteCountToDisplaySize(stats.getIndices().getStore().getSizeInBytes()));
setAttribute(protobuf, "Open File Descriptors", stats.getProcess().getOpenFileDescriptors());
@Test
public void node_attributes() {
ProtobufSystemInfo.Section section = underTest.toProtobuf();
+ assertThat(attribute(section, "CPU Usage (%)")).isNotNull();
+ assertThat(attribute(section, "Disk Available")).isNotNull();
assertThat(attribute(section, "Store Size")).isNotNull();
}