File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
server/src/main/java/org/elasticsearch/monitor/os Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
120120
121121 public static class Cpu implements Writeable , ToXContentFragment {
122122
123- private static final String AVAILABLE_PROCESSORS_TRANSPORT_VERSION = "available_processors_in_os_stats" ;
123+ private static final TransportVersion AVAILABLE_PROCESSORS_TRANSPORT_VERSION = TransportVersion .fromName (
124+ "available_processors_in_os_stats"
125+ );
124126
125127 private final short percent ;
126128 private final double [] loadAverage ;
@@ -139,9 +141,7 @@ public Cpu(StreamInput in) throws IOException {
139141 } else {
140142 this .loadAverage = null ;
141143 }
142- this .availableProcessors = in .getTransportVersion ().supports (TransportVersion .fromName (AVAILABLE_PROCESSORS_TRANSPORT_VERSION ))
143- ? in .readInt ()
144- : 0 ;
144+ this .availableProcessors = in .getTransportVersion ().supports (AVAILABLE_PROCESSORS_TRANSPORT_VERSION ) ? in .readInt () : 0 ;
145145 }
146146
147147 @ Override
@@ -153,7 +153,7 @@ public void writeTo(StreamOutput out) throws IOException {
153153 out .writeBoolean (true );
154154 out .writeDoubleArray (loadAverage );
155155 }
156- if (out .getTransportVersion ().supports (TransportVersion . fromName ( AVAILABLE_PROCESSORS_TRANSPORT_VERSION ) )) {
156+ if (out .getTransportVersion ().supports (AVAILABLE_PROCESSORS_TRANSPORT_VERSION )) {
157157 out .writeInt (availableProcessors );
158158 }
159159 }
You can’t perform that action at this time.
0 commit comments