Skip to content

stat: Add counterFromStatName(), gaugeFromStatName(), and histogramFromStatName()#6475

Merged
mattklein123 merged 7 commits intoenvoyproxy:masterfrom
jmarantz:stat-from-stat-name
Apr 5, 2019
Merged

stat: Add counterFromStatName(), gaugeFromStatName(), and histogramFromStatName()#6475
mattklein123 merged 7 commits intoenvoyproxy:masterfrom
jmarantz:stat-from-stat-name

Conversation

@jmarantz
Copy link
Contributor

@jmarantz jmarantz commented Apr 3, 2019

Description: #6161 is a 45-file PR that converts the stats infrastructure to use a SymbolTable API for representing names, which is challenging to review due to several concepts occurring at once. This PR factors out one of the concepts: the new APIs for Stats::Store and Stats::Scope.
Risk Level: low -- this introduces new APIs that are not actually used yet, though they are tested.
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a

jmarantz added 4 commits April 3, 2019 16:17
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz jmarantz marked this pull request as ready for review April 4, 2019 13:46
ambuc
ambuc previously approved these changes Apr 4, 2019
Copy link
Contributor

@ambuc ambuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Could you modify the stats-specific README to show where in the process this PR leaves us?

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz
Copy link
Contributor Author

jmarantz commented Apr 4, 2019

I'm a little reluctant to hack the doc as this is not a meaningful change to the operation of stats in this PR, just a new API this is defined and tested but not used. #6161 changes operations and explains how and why in stats.md.

@jmarantz
Copy link
Contributor Author

jmarantz commented Apr 4, 2019

Matt -- this should be pretty easy; an incremental step requested by @ambuc in advance of #6161

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with 1 question/comment.

/wait-any


// Variant of ScopePrefixer that references the scope being prefixed, but does
// not own it.
ScopePrefixer::ScopePrefixer(absl::string_view prefix, Scope& scope)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this variant used, is it used in a follow up?

Also, somewhat nitty, but for clarity I would prefer a single constructor that looks like:

ScopePrefixer::ScopePrefixer(absl::string_view prefix, Scope& scope, bool take_ownership)

And then personally I would have the following members:

std::unique_ptr<Scope> owned_scope_;
Scope* scope_to_use_;

And avoid the manual deletion. WDYT?

Copy link
Contributor Author

@jmarantz jmarantz Apr 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I like your pattern better. However I also can't justify the speculative generality here; I needed it in some past iteration and don't see a use-case now. If I have to add it back in the future I'll use your pattern.

update coming.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
… scope.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@mattklein123 mattklein123 merged commit 2b17061 into envoyproxy:master Apr 5, 2019
mpuncel added a commit to mpuncel/envoy that referenced this pull request Apr 8, 2019
* master: (137 commits)
  test: router upstream log to v2 config stubs (envoyproxy#6499)
  remove idle timeout validation (envoyproxy#6500)
  build: Change namespace of chromium_url. (envoyproxy#6506)
  coverage: exclude chromium_url (envoyproxy#6498)
  fix(tracing): allow 256 chars in path tag (envoyproxy#6492)
  Common: Introduce StopAllIteration filter status for decoding and encoding filters (envoyproxy#5954)
  build: update PGV url (envoyproxy#6495)
  subset lb: avoid partitioning host lists on worker threads (envoyproxy#6302)
  ci: Make envoy_select_quiche no-op. (envoyproxy#6393)
  watcher: notify when watched files are modified (envoyproxy#6215)
  stat: Add counterFromStatName(), gaugeFromStatName(), and histogramFromStatName() (envoyproxy#6475)
  bump to 1.11.0-dev (envoyproxy#6490)
  release: bump to 1.10.0 (envoyproxy#6489)
  hcm: path normalization. (#1)
  build: import manually minified Chrome URL lib. (envoyproxy#3)
  codec: reject embedded NUL in headers. (envoyproxy#2)
  Added veryfication if path contains query params and add them to path header (envoyproxy#6466)
  redis: basic integration test for redis_proxy (envoyproxy#6450)
  stats: report sample count as an integer to prevent loss of precision (envoyproxy#6274)
  Added VHDS protobuf message and updated RouteConfig to include it. (envoyproxy#6418)
  ...

Signed-off-by: Michael Puncel <mpuncel@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants