Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
Signed-off-by: Dhrubo Saha <[email protected]>
  • Loading branch information
dhrubo-os committed Oct 3, 2023
1 parent 0bdf991 commit 78c458b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class MLStatsNodeResponse extends BaseNodeResponse implements ToXContentF
*/
private Map<FunctionName, MLAlgoStats> algorithmStats;
/**
* Model stats which includes stats level stats.
* Model stats which includes model level stats.
*
* Example: {model_id: { predict: { request_count: 1} }}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public MLModelStats(Map<ActionName, MLActionStats> modelStats) {

@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeMap(modelStats, (stream, v) -> stream.writeEnum(v), (stream, stats) -> stats.writeTo(stream));
if (modelStats != null && modelStats.size() > 0) {
out.writeMap(modelStats, (stream, v) -> stream.writeEnum(v), (stream, stats) -> stats.writeTo(stream));
}
}

@Override
Expand Down

0 comments on commit 78c458b

Please sign in to comment.