forked from lix-project/lix
b8eea7e81a
istream->tellg() returns -1 so we can't get the number of bytes written. Fixes 'uploaded 's3://nix-cache/nar/00819r9lp5kajr6baxfw5dhhc0cx8ndxaz43qmd2f0gn1hk1ynlp.nar.xz' (-1 bytes) in 11620 ms' messages.
33 lines
575 B
C++
33 lines
575 B
C++
#pragma once
|
|
|
|
#include "binary-cache-store.hh"
|
|
|
|
#include <atomic>
|
|
|
|
namespace nix {
|
|
|
|
class S3BinaryCacheStore : public BinaryCacheStore
|
|
{
|
|
protected:
|
|
|
|
S3BinaryCacheStore(const Params & params)
|
|
: BinaryCacheStore(params)
|
|
{ }
|
|
|
|
public:
|
|
|
|
struct Stats
|
|
{
|
|
std::atomic<uint64_t> put{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};
|
|
};
|
|
|
|
virtual const Stats & getS3Stats() = 0;
|
|
};
|
|
|
|
}
|