• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

llnl / dftracer-utils / 28693295402

04 Jul 2026 03:17AM UTC coverage: 52.408% (+0.1%) from 52.278%
28693295402

push

github

hariharan-devarajan
feat: silence noisy warnings on aarch64

37318 of 92666 branches covered (40.27%)

Branch coverage included in aggregate %.

33462 of 42389 relevant lines covered (78.94%)

20557.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

68.89
/src/dftracer/utils/core/rocksdb/key_codec.cpp
1
#include <dftracer/utils/core/common/error.h>
2
#include <dftracer/utils/core/rocksdb/key_codec.h>
3

4
#include <stdexcept>
5

6
namespace dftracer::utils::rocksdb {
7

8
namespace {
9

10
template <typename T>
11
T decode_big_endian(std::string_view bytes) {
567,129✔
12
    if (bytes.size() != sizeof(T)) {
567,129!
13
        throw DFTUtilsException(ErrorCode::PARSE,
×
14
                                "KeyCodec: invalid big-endian integer width");
×
15
    }
16

17
    T value = 0;
567,119✔
18
    for (unsigned char byte : bytes) {
4,795,267✔
19
        value = static_cast<T>((value << 8U) | byte);
4,228,148✔
20
    }
21
    return value;
567,150✔
22
}
23

24
}  // namespace
25

26
std::string KeyCodec::encode_be32(std::uint32_t value) {
32,895✔
27
    std::string out;
32,895✔
28
    out.reserve(sizeof(value));
32,887!
29
    append_be32(out, value);
32,881!
30
    return out;
32,895✔
31
}
16,477!
32

33
std::string KeyCodec::encode_be64(std::uint64_t value) {
2,884✔
34
    std::string out;
2,884✔
35
    out.reserve(sizeof(value));
2,885!
36
    append_be64(out, value);
2,883!
37
    return out;
2,887✔
38
}
1,445!
39

40
std::uint32_t KeyCodec::decode_be32(std::string_view bytes) {
77,140✔
41
    return decode_big_endian<std::uint32_t>(bytes);
77,140✔
42
}
43

44
std::uint64_t KeyCodec::decode_be64(std::string_view bytes) {
490,017✔
45
    return decode_big_endian<std::uint64_t>(bytes);
490,017✔
46
}
47

48
void KeyCodec::append_be32(std::string& out, std::uint32_t value) {
136,033✔
49
    for (int shift = 24; shift >= 0; shift -= 8) {
679,429✔
50
        out.push_back(static_cast<char>((value >> shift) & 0xFFU));
543,652✔
51
    }
272,379✔
52
}
135,777✔
53

54
void KeyCodec::append_be64(std::string& out, std::uint64_t value) {
139,570✔
55
    for (int shift = 56; shift >= 0; shift -= 8) {
1,253,387✔
56
        out.push_back(static_cast<char>((value >> shift) & 0xFFU));
1,114,038✔
57
    }
558,495✔
58
}
139,349✔
59

60
KeyBuilder& KeyBuilder::append_tag(std::string_view tag) {
2✔
61
    key_.append(tag);
2✔
62
    return *this;
2✔
63
}
64

65
KeyBuilder& KeyBuilder::append_separator() {
2✔
66
    key_.push_back('\0');
2✔
67
    return *this;
2✔
68
}
69

70
KeyBuilder& KeyBuilder::append_string(std::string_view value) {
×
71
    key_.append(value);
×
72
    return *this;
×
73
}
74

75
KeyBuilder& KeyBuilder::append_be32(std::uint32_t value) {
2✔
76
    KeyCodec::append_be32(key_, value);
2✔
77
    return *this;
2✔
78
}
79

80
KeyBuilder& KeyBuilder::append_be64(std::uint64_t value) {
2✔
81
    KeyCodec::append_be64(key_, value);
2✔
82
    return *this;
2✔
83
}
84

85
std::string KeyBuilder::build() const { return key_; }
2✔
86

87
void KeyBuilder::clear() { key_.clear(); }
×
88

89
}  // namespace dftracer::utils::rocksdb
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc