Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Stats::RawStatData into a StatsOptions struct #3629

Merged
merged 24 commits into from
Jul 13, 2018

Commits on Jul 10, 2018

  1. Refactor Stats::RawStatData into a StatsOptions struct.

    This change allows us to deprecate the statics inside Stats::RawStatData. Some side effects of this change are: a) HeapRawStatDataAllocator no longer performs stat name truncation, b) we now construct BlockMemoryHashSet, HotRestartImpl, C/L/RdsSubscription, and ThreadLocalStoreImpl as functions of this Stats::StatsOptions struct, and c) Stats::RawStatData now looks more like a set of libraries for computing stat padding, as opposed to a source of truth for the maximum allowable name lengths. Finally, a chain of functions starting under server.cc (translateBootstrap, translateClusterManagerBootstrap, translateListener, translateCluster, translateVirtualHost) have had Stats::StatsOptions& added to their interfaces, so that Utility::checkObjNameLength() can be called with the necessary context.
    
    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    bb349a1 View commit details
    Browse the repository at this point in the history
  2. Store StatsOptions values as size_t

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    7bfa762 View commit details
    Browse the repository at this point in the history
  3. Add heapAllocator stat name truncation in ThreadLocalStore, plus nits

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    27990bf View commit details
    Browse the repository at this point in the history
  4. Remove unused BlockMemoryHashSet accessor function

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    b92ab75 View commit details
    Browse the repository at this point in the history
  5. Rename safeInitialize() to truncateAndInit()

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    3a7aff1 View commit details
    Browse the repository at this point in the history
  6. Change interface of sizeGivenName()

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    3f38407 View commit details
    Browse the repository at this point in the history
  7. Use new translateBootstrap interface in v1_to_bootstrap

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    19f9f3c View commit details
    Browse the repository at this point in the history
  8. Fix formatting

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    06bd4c2 View commit details
    Browse the repository at this point in the history
  9. Add documentation, re-trigger ci

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    217f72f View commit details
    Browse the repository at this point in the history
  10. Rework some interfaces to pass statsOptions rather than Scope at lowe…

    …r levels
    
    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    1ae932c View commit details
    Browse the repository at this point in the history
  11. Prefer UNREFERENCED_PARAMETER to (void)

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    b07d5c6 View commit details
    Browse the repository at this point in the history
  12. Better inline docs for stat name / object / suffix terminology

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 10, 2018
    Configuration menu
    Copy the full SHA
    732af4f View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    7328dc0 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2018

  1. Edit stats inline documentation

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 11, 2018
    Configuration menu
    Copy the full SHA
    71f6b24 View commit details
    Browse the repository at this point in the history
  2. Provide safe copy assertion in RawStatData::initialize()

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 11, 2018
    Configuration menu
    Copy the full SHA
    2aa9d8c View commit details
    Browse the repository at this point in the history
  3. Abstract checkAndInit() and truncateAndInit() with shared initializat…

    …ion logic
    
    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 11, 2018
    Configuration menu
    Copy the full SHA
    911fc5d View commit details
    Browse the repository at this point in the history
  4. Formatting fixes and nits

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 11, 2018
    Configuration menu
    Copy the full SHA
    dbcdb72 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2018

  1. Merge remote-tracking branch 'upstream/master' into refactor-StatsOpt…

    …ions
    
    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 12, 2018
    Configuration menu
    Copy the full SHA
    9a30244 View commit details
    Browse the repository at this point in the history
  2. Refactor sizeGivenName(), sizeGivenStatsOptions() into structSize(), …

    …structSizeWithOptions()
    
    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 12, 2018
    Configuration menu
    Copy the full SHA
    aeb9251 View commit details
    Browse the repository at this point in the history
  3. Add todo addressing embedded assumption about allocator fallback

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 12, 2018
    Configuration menu
    Copy the full SHA
    cb0fd8a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    19e0311 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2018

  1. Throw std::bad_alloc() in HeapRawStatDataAllocator::alloc()

    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    4cad816 View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'upstream/master' into refactor-StatsOpt…

    …ions
    
    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    9c6b880 View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'upstream/master' into refactor-StatsOpt…

    …ions
    
    Signed-off-by: James Buckland <jbuckland@google.com>
    ambuc committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    c1fa6fb View commit details
    Browse the repository at this point in the history