/*
 *  Copyright (c) 2004-present, Facebook, Inc.
 *  All rights reserved.
 *
 *  This source code is licensed under the BSD-style license found in the
 *  LICENSE file in the root directory of this source tree. An additional grant
 *  of patent rights can be found in the PATENTS file in the same directory.
 *
 */
#pragma once

#include <folly/Range.h>
#include <chrono>

namespace facebook {

class SpinLock {
};

class SpinLockHolder {
public:
  explicit SpinLockHolder(SpinLock*) {}
};

namespace stats {

enum ExportType {
  SUM,
  COUNT,
  AVG,
  RATE,
  PERCENT,
  NUM_TYPES,
};

struct ExportedStat {
  void addValue(std::chrono::seconds, int64_t) {}
};

class ExportedStatMap {
public:
  class LockAndStatItem {
  public:
    std::shared_ptr<SpinLock> first;
    std::shared_ptr<ExportedStat> second;
  };
  LockAndStatItem getLockAndStatItem(folly::StringPiece,
                                     const ExportType* = nullptr) {
    static LockAndStatItem it = {
      std::make_shared<SpinLock>(), std::make_shared<ExportedStat>()
    };
    return it;
  }

  std::shared_ptr<ExportedStat> getStatPtr(folly::StringPiece name) {
      return std::make_shared<ExportedStat>();
  }
};

}}

/*
 *  Copyright (c) 2004-present, Facebook, Inc.
 *  All rights reserved.
 *
 *  This source code is licensed under the BSD-style license found in the
 *  LICENSE file in the root directory of this source tree. An additional grant
 *  of patent rights can be found in the PATENTS file in the same directory.
 *
 */
#pragma once

#include <folly/Range.h>
#include <chrono>

namespace facebook {

class SpinLock {
};

class SpinLockHolder {
public:
  explicit SpinLockHolder(SpinLock*) {}
};

namespace stats {

enum ExportType {
  SUM,
  COUNT,
  AVG,
  RATE,
  PERCENT,
  NUM_TYPES,
};

struct ExportedStat {
  void addValue(std::chrono::seconds, int64_t) {}
};

class ExportedStatMap {
public:
  class LockAndStatItem {
  public:
    std::shared_ptr<SpinLock> first;
    std::shared_ptr<ExportedStat> second;
  };
  LockAndStatItem getLockAndStatItem(folly::StringPiece,
                                     const ExportType* = nullptr) {
    static LockAndStatItem it = {
      std::make_shared<SpinLock>(), std::make_shared<ExportedStat>()
    };
    return it;
  }
};

}}

--- 
+++ 
@@ -51,6 +51,10 @@
     };
     return it;
   }
+
+  std::shared_ptr<ExportedStat> getStatPtr(folly::StringPiece name) {
+      return std::make_shared<ExportedStat>();
+  }
 };
 
 }}
Fix some build issues in the open source code.

Summary:
Our code grew some implicit transitive dependencies on
the headers that internal headers included, but our stubs
did not. This fixes that, and updates our stubs to match
what our code expects.

Test Plan: Apply to open source repository and test.

Reviewed By: yfeldblum@fb.com

Subscribers: fbcode-common-diffs@, net-systems@, yfeldblum

FB internal diff: D1982664

Signature: t1:1982664:1428695964:3fd76243d013ca4969c0dcd91f97e3292cf13c1f

Signed-off-by: Ori Bernstein <f1fed15cf5b8387c8aee8bc535d6c2b48da91000@fb.com>
