Keep some statistics for the binary cache stores

This commit is contained in:
Eelco Dolstra
2016-02-19 14:24:23 +01:00
parent dc4a00347d
commit a0f74047da
5 changed files with 160 additions and 30 deletions

View File

@@ -2,6 +2,8 @@
#include "binary-cache-store.hh"
#include <atomic>
namespace Aws { namespace Client { class ClientConfiguration; } }
namespace Aws { namespace S3 { class S3Client; } }
@@ -24,8 +26,23 @@ public:
void init() override;
struct Stats
{
std::atomic<uint64_t> put{0};
std::atomic<uint64_t> putBytes{0};
std::atomic<uint64_t> putTimeMs{0};
std::atomic<uint64_t> get{0};
std::atomic<uint64_t> getBytes{0};
std::atomic<uint64_t> getTimeMs{0};
std::atomic<uint64_t> head{0};
};
const Stats & getS3Stats();
private:
Stats stats;
ref<Aws::Client::ClientConfiguration> makeConfig();
protected: