Skip to content

Commit

Permalink
Add additional check and update error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
yinggeh committed Oct 31, 2024
1 parent accbec5 commit 2006d20
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/model_config_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1627,19 +1627,25 @@ ValidateModelConfig(
if (!metric_control.has_metric_identifier()) {
return Status(
Status::Code::INVALID_ARG,
"model_control must specify 'metric_identifier'");
"metric control must specify 'metric_identifier'");
}

if (metric_control.metric_identifier().family().empty()) {
return Status(
Status::Code::INVALID_ARG,
"metric_identifier must specify 'family'");
"metric identifier must specify non-empty 'family'");
}

if (!metric_control.has_histogram_options()) {
return Status(
Status::Code::INVALID_ARG,
"model_control must specify 'histogram_options'");
"metric control must specify 'histogram_options'");
}

if (metric_control.histogram_options().buckets_size() == 0) {
return Status(
Status::Code::INVALID_ARG,
"histogram options must specify non-empty 'buckets'");
}
}
#else
Expand Down

0 comments on commit 2006d20

Please sign in to comment.