message: open source exportThriftFuncHist
  Summary: exportThriftFuncHist is used by Eden so expose it in BaseService.
diff: #include <fb303/ServiceData.h>
  #include <fb303/thrift/gen-cpp2/BaseService.h>
  +#include <folly/small_vector.h>
  namespace facebook {
  namespace fb303 {
  +enum ThriftFuncAction {
  + FIRST_ACTION = 0,
  + READ = FIRST_ACTION,
  + WRITE,
  + PROCESS,
  + BYTES_READ,
  + BYTES_WRITTEN,
  + LAST_ACTION
  +};
  +
  +struct ThriftFuncHistParams {
  + explicit ThriftFuncHistParams(
  + const std::string& funcName_,
  + ThriftFuncAction action_,
  + folly::small_vector<int> percentiles_,
  + int64_t bucketSize_,
  + int64_t min_,
  + int64_t max_)
  + : funcName(funcName_),
  + action(action_),
  + percentiles(std::move(percentiles_)),
  + bucketSize(bucketSize_),
  + min(min_),
  + max(max_) {}
  +
  + std::string funcName;
  + ThriftFuncAction action;
  + folly::small_vector<int> percentiles;
  + int64_t bucketSize;
  + int64_t min;
  + int64_t max;
  +};
  +
  class BaseService : virtual public cpp2::BaseServiceSvIf {
  protected:
  explicit BaseService(std::string name) : name_{std::move(name)} {}
  @@ -121,8 +155,52 @@ class BaseService : virtual public cpp2::BaseServiceSvIf {
  return ServiceData::get()->getAliveSince().count();
  }
  + /**
  + * Add an automatically sampled and consolidated histogram stat for a
  + * thrift function. It adds histogram stats like
  + * thrift.SERVICE.FUNCTION.PXX.INTERVAL to fb303.
  + *
  + * @param funcName full function name, like SERVICE.FUNCTION
  + * @param action time for READ/WRITE/PROCESS
  + * @param percentiles define pxx
  + * @param bucketSize size of each bucket
  + * @param min min value of the histogram
  + * @param max max value of the histogram
  + */
  + void exportThriftFuncHist(
  + const std::string& funcName,
  + ThriftFuncAction action,
  + folly::small_vector<int> percentiles,
  + int64_t bucketSize,
  + int64_t min,
  + int64_t max) {
  + thriftFuncHistParams_.emplace_back(
  + funcName, action, percentiles, bucketSize, min, max);
  + }
  +
  + void exportThriftFuncHist(
  + const std::string& funcName,
  + ThriftFuncAction action,
  + int percentile,
  + int64_t bucketSize,
  + int64_t min,
  + int64_t max) {
  + exportThriftFuncHist(
  + funcName,
  + action,
  + folly::small_vector<int>({percentile}),
  + bucketSize,
  + min,
  + max);
  + }
  +
  + std::vector<ThriftFuncHistParams>* getExportedThriftFuncHist() {
  + return &thriftFuncHistParams_;
  + }
  +
  private:
  const std::string name_;
  + std::vector<ThriftFuncHistParams> thriftFuncHistParams_;
  };
  } // namespace fb303
  