diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-10-08 11:53:59 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-10-08 11:53:59 +0000 |
commit | e850fa94aac919681f3528472edf29c215512780 (patch) | |
tree | 47f923eb23b7c1f3b496cb4fac63caa0274ed931 | |
parent | 8ade6a2dddcf4e258dec8c291ddfb193ffc88b8d (diff) |
rename Repo -> NameRepo
-rw-r--r-- | metrics/src/vespa/metrics/CMakeLists.txt | 2 | ||||
-rw-r--r-- | metrics/src/vespa/metrics/metric.cpp | 14 | ||||
-rw-r--r-- | metrics/src/vespa/metrics/metric.h | 16 | ||||
-rw-r--r-- | metrics/src/vespa/metrics/name_repo.cpp (renamed from metrics/src/vespa/metrics/repo.cpp) | 18 | ||||
-rw-r--r-- | metrics/src/vespa/metrics/name_repo.h (renamed from metrics/src/vespa/metrics/repo.h) | 2 |
5 files changed, 26 insertions, 26 deletions
diff --git a/metrics/src/vespa/metrics/CMakeLists.txt b/metrics/src/vespa/metrics/CMakeLists.txt index 69088528a61..147e88cd61c 100644 --- a/metrics/src/vespa/metrics/CMakeLists.txt +++ b/metrics/src/vespa/metrics/CMakeLists.txt @@ -14,7 +14,7 @@ vespa_add_library(metrics metricvalueset.cpp namehash.cpp printutils.cpp - repo.cpp + name_repo.cpp state_api_adapter.cpp summetric.cpp textwriter.cpp diff --git a/metrics/src/vespa/metrics/metric.cpp b/metrics/src/vespa/metrics/metric.cpp index 63d0f1d9f20..05483a5be11 100644 --- a/metrics/src/vespa/metrics/metric.cpp +++ b/metrics/src/vespa/metrics/metric.cpp @@ -52,8 +52,8 @@ namespace { vespalib::Regexp Metric::_namePattern(namePattern); Tag::Tag(vespalib::stringref k, vespalib::stringref v) - : _key(Repo::tagKeyId(k)), - _value(Repo::tagValueId(v)) + : _key(NameRepo::tagKeyId(k)), + _value(NameRepo::tagValueId(v)) { } Tag::Tag(const Tag &) = default; @@ -64,9 +64,9 @@ Metric::Metric(const String& name, const String& tags, const String& description, MetricSet* owner) - : _name(Repo::metricId(name)), + : _name(NameRepo::metricId(name)), _mangledName(_name), - _description(Repo::descriptionId(description)), + _description(NameRepo::descriptionId(description)), _tags(legacyTagStringToKeyedTags(tags)), _owner(nullptr) // Set later by registry { @@ -79,9 +79,9 @@ Metric::Metric(const String& name, Tags dimensions, const String& description, MetricSet* owner) - : _name(Repo::metricId(name)), + : _name(NameRepo::metricId(name)), _mangledName(_name), - _description(Repo::descriptionId(description)), + _description(NameRepo::descriptionId(description)), _tags(std::move(dimensions)), _owner(nullptr) { @@ -124,7 +124,7 @@ Metric::assignMangledNameWithDimensions() } sortTagsInDeterministicOrder(); vespalib::string mangled = createMangledNameWithDimensions(); - _mangledName = Repo::metricId(mangled); + _mangledName = NameRepo::metricId(mangled); } void diff --git a/metrics/src/vespa/metrics/metric.h b/metrics/src/vespa/metrics/metric.h index 85b47fb4d97..dc9e45e89af 100644 --- a/metrics/src/vespa/metrics/metric.h +++ b/metrics/src/vespa/metrics/metric.h @@ -4,7 +4,7 @@ #include <vespa/vespalib/util/printable.h> #include <vespa/vespalib/stllike/string.h> #include <vespa/vespalib/util/regexp.h> -#include "repo.h" +#include "name_repo.h" namespace metrics { @@ -83,8 +83,8 @@ struct MetricVisitor { */ struct Tag { - const vespalib::string& key() const { return Repo::tagKey(_key); } - const vespalib::string& value() const { return Repo::tagValue(_value); } + const vespalib::string& key() const { return NameRepo::tagKey(_key); } + const vespalib::string& value() const { return NameRepo::tagValue(_value); } Tag(vespalib::stringref k, vespalib::stringref v); Tag(const Tag &); @@ -124,17 +124,17 @@ public: Metric & operator = (Metric && rhs) = default; ~Metric(); - const vespalib::string& getName() const { return Repo::metricName(_name); } + const vespalib::string& getName() const { return NameRepo::metricName(_name); } /** * Get mangled name iff the metric contains any dimensions, otherwise * the original metric name is returned. */ const vespalib::string& getMangledName() const { - return Repo::metricName(_mangledName); + return NameRepo::metricName(_mangledName); } vespalib::string getPath() const; std::vector<String> getPathVector() const; - const vespalib::string& getDescription() const { return Repo::description(_description); } + const vespalib::string& getDescription() const { return NameRepo::description(_description); } const Tags& getTags() const { return _tags; } /** Return whether there exists a tag with a key equal to 'tag' */ bool hasTag(const String& tag) const; @@ -220,14 +220,14 @@ public: /** Used by sum metric to alter name of cloned metric for sum. */ void setName(const String& name) { - MetricNameId newName = Repo::metricId(name); + MetricNameId newName = NameRepo::metricId(name); _name = newName; assignMangledNameWithDimensions(); } /** Used by sum metric to alter description of cloned metric for sum. */ void setDescription(const vespalib::string& d) { - _description = Repo::descriptionId(d); + _description = NameRepo::descriptionId(d); } /** Used by sum metric to alter tag of cloned metric for sum. */ void setTags(Tags tags) { diff --git a/metrics/src/vespa/metrics/repo.cpp b/metrics/src/vespa/metrics/name_repo.cpp index a43eec8babe..380120194d7 100644 --- a/metrics/src/vespa/metrics/repo.cpp +++ b/metrics/src/vespa/metrics/name_repo.cpp @@ -1,6 +1,6 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include "repo.h" +#include "name_repo.h" #include <vespa/vespalib/metrics/name_collection.h> using vespalib::metrics::NameCollection; @@ -15,53 +15,53 @@ NameCollection tagValues; } MetricNameId -Repo::metricId(const vespalib::string &name) +NameRepo::metricId(const vespalib::string &name) { size_t id = metricNames.resolve(name); return MetricNameId(id); } DescriptionId -Repo::descriptionId(const vespalib::string &name) +NameRepo::descriptionId(const vespalib::string &name) { size_t id = descriptions.resolve(name); return DescriptionId(id); } TagKeyId -Repo::tagKeyId(const vespalib::string &name) +NameRepo::tagKeyId(const vespalib::string &name) { size_t id = tagKeys.resolve(name); return TagKeyId(id); } TagValueId -Repo::tagValueId(const vespalib::string &value) +NameRepo::tagValueId(const vespalib::string &value) { size_t id = tagValues.resolve(value); return TagValueId(id); } const vespalib::string& -Repo::metricName(MetricNameId id) +NameRepo::metricName(MetricNameId id) { return metricNames.lookup(id.id()); } const vespalib::string& -Repo::description(DescriptionId id) +NameRepo::description(DescriptionId id) { return descriptions.lookup(id.id()); } const vespalib::string& -Repo::tagKey(TagKeyId id) +NameRepo::tagKey(TagKeyId id) { return tagKeys.lookup(id.id()); } const vespalib::string& -Repo::tagValue(TagValueId id) +NameRepo::tagValue(TagValueId id) { return tagValues.lookup(id.id()); } diff --git a/metrics/src/vespa/metrics/repo.h b/metrics/src/vespa/metrics/name_repo.h index 3e59b4550d9..44f8f622bff 100644 --- a/metrics/src/vespa/metrics/repo.h +++ b/metrics/src/vespa/metrics/name_repo.h @@ -16,7 +16,7 @@ using DescriptionId = vespalib::metrics::Handle<DescriptionIdTag>; using TagKeyId = vespalib::metrics::Handle<TagKeyIdTag>; using TagValueId = vespalib::metrics::Handle<TagValueIdTag>; -struct Repo { +struct NameRepo { static MetricNameId metricId(const vespalib::string &name); static DescriptionId descriptionId(const vespalib::string &name); static TagKeyId tagKeyId(const vespalib::string &name); |