sapling/common/stats/ServiceData.h
Adam Simpkins 7f58caffe4 Add fb303 stubs in common/ to support building in the opensource repo
Summary:
This adds a common/ directory with stub files required for building
eden.  These stubs are the same ones as used in the fboss repository:
https://github.com/facebook/fboss/

Our goal is to eventually create an opensource fb303 repository with
complete implementations of these files, but for now these basic stubs
allow building eden.  (Most of the underlying stats code that supports
fb303 is already available in folly/stats/ in the folly repository.)

Test Plan:
Tested building eden on Ubuntu 16.04
2017-03-17 17:08:05 -07:00

40 lines
966 B
C++

/*
* 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 "common/stats/ExportedStatMap.h"
#include "common/stats/ExportedHistogramMap.h"
#include <map>
namespace facebook { namespace stats {
class ServiceData {
public:
ExportedStatMap* getStatMap() {
static ExportedStatMap it;
return &it;
}
ExportedHistogramMap* getHistogramMap() {
static ExportedHistogramMap it;
return &it;
}
void getCounters(std::map<std::string, int64_t>&) {}
long getCounter(std::string) {return 0;};
long clearCounter(std::string) {return 0;};
void setUseOptionsAsFlags(bool) {}
void setCounter(folly::StringPiece, uint32_t) {}
};
}
extern stats::ServiceData* fbData;
}