about summary refs log tree commit diff
path: root/src/libstore/s3-binary-cache-store.hh
blob: 0425f6bb95d96ab7d0da8b6d7f7be73b6e6d76a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include "binary-cache-store.hh"

#include <atomic>

namespace nix {

class S3BinaryCacheStore : public BinaryCacheStore
{
protected:

    S3BinaryCacheStore(std::shared_ptr<Store> localStore,
        const Path & secretKeyFile)
        : BinaryCacheStore(localStore, secretKeyFile)
    { }

public:

    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();
};

}