Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 674600387
  • Loading branch information
Google-ML-Automation committed Sep 14, 2024
1 parent 5f20098 commit 91e71d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion third_party/tsl/tsl/lib/monitoring/collection_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void Collector::CollectMetricDescriptor(
metric_descriptor->name = string(metric_def->name());
metric_descriptor->description = string(metric_def->description());

for (const StringPiece label_name : metric_def->label_descriptions()) {
for (const absl::string_view label_name : metric_def->label_descriptions()) {
metric_descriptor->label_names.emplace_back(label_name);
}

Expand Down
2 changes: 1 addition & 1 deletion third_party/tsl/tsl/lib/monitoring/collection_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class CollectionRegistry {
CollectionFunction collection_function;
uint64 registration_time_millis;
};
std::map<StringPiece, CollectionInfo> registry_ TF_GUARDED_BY(mu_);
std::map<absl::string_view, CollectionInfo> registry_ TF_GUARDED_BY(mu_);

CollectionRegistry(const CollectionRegistry&) = delete;
void operator=(const CollectionRegistry&) = delete;
Expand Down
9 changes: 5 additions & 4 deletions third_party/tsl/tsl/lib/monitoring/metric_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ class AbstractMetricDef {

ValueType value_type() const { return value_type_; }

StringPiece name() const { return name_; }
absl::string_view name() const { return name_; }

StringPiece description() const { return description_; }
absl::string_view description() const { return description_; }

const std::vector<string>& label_descriptions() const {
return label_descriptions_;
Expand All @@ -136,7 +136,8 @@ class AbstractMetricDef {
friend class MetricDef;

AbstractMetricDef(const MetricKind kind, const ValueType value_type,
const StringPiece name, const StringPiece description,
const absl::string_view name,
const absl::string_view description,
const std::vector<string>& label_descriptions)
: kind_(kind),
value_type_(value_type),
Expand Down Expand Up @@ -168,7 +169,7 @@ template <MetricKind metric_kind, typename Value, int NumLabels>
class MetricDef : public AbstractMetricDef {
public:
template <typename... LabelDesc>
MetricDef(const StringPiece name, const StringPiece description,
MetricDef(const absl::string_view name, const absl::string_view description,
const LabelDesc&... label_descriptions)
: AbstractMetricDef(metric_kind, internal::GetValueType<Value>(), name,
description, {label_descriptions...}) {
Expand Down

0 comments on commit 91e71d2

Please sign in to comment.