Skip to content

Commit

Permalink
Fixes tensorflow_serving continuous build.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 615451402
  • Loading branch information
CMinge authored and tensorflow-copybara committed Mar 13, 2024
1 parent f82600a commit a99fb9c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tensorflow_serving/model_servers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ cc_library(
"//tensorflow_serving/apis:model_service_cc_proto",
"//tensorflow_serving/util:status_util",
"@com_google_absl//absl/container:flat_hash_map",
"@org_tensorflow//tensorflow/core:lib",
"@local_tsl//tsl/lib/monitoring:collected_metrics",
"@local_tsl//tsl/lib/monitoring:collection_registry",
],
)

Expand Down
5 changes: 3 additions & 2 deletions tensorflow_serving/model_servers/model_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ absl::flat_hash_map<std::string, int64_t> ModelServiceImpl::GetMetrics(

for (const std::string &metric_name : request->metric_names()) {
int64_t metric_value = 0;
if (collected_metrics->point_set_map.contains(metric_name)) {
auto it = collected_metrics->point_set_map.find(metric_name);
if (it != collected_metrics->point_set_map.end()) {
std::vector<std::unique_ptr<tsl::monitoring::Point>> *points =
&collected_metrics->point_set_map[metric_name]->points;
&it->second->points;
if (!points->empty()) {
metric_value = (*points)[0]->int64_value;
}
Expand Down
1 change: 1 addition & 0 deletions tensorflow_serving/model_servers/model_service_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.

#include "grpcpp/server_context.h"
#include "grpcpp/support/status.h"
#include "absl/container/flat_hash_map.h"
#include "tensorflow_serving/apis/model_management.pb.h"
#include "tensorflow_serving/apis/model_service.grpc.pb.h"
#include "tensorflow_serving/apis/model_service.pb.h"
Expand Down

0 comments on commit a99fb9c

Please sign in to comment.