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

llnl / dftracer-utils / 27052412546

06 Jun 2026 04:20AM UTC coverage: 50.862% (+1.0%) from 49.905%
27052412546

Pull #73

github

web-flow
Merge 734572730 into 88a3c8457
Pull Request #73: add portable dependencies wheel support

31801 of 79859 branches covered (39.82%)

Branch coverage included in aggregate %.

32491 of 46545 relevant lines covered (69.81%)

9947.11 hits per line

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

46.67
/src/dftracer/utils/core/env.cpp
1
#include <dftracer/utils/core/env.h>
2

3
#include <charconv>
4
#include <cstdlib>
5
#include <string>
6

7
namespace dftracer::utils {
8

9
template <>
10
std::optional<std::string_view> Env::get<std::string_view>(
98✔
11
    std::string_view name) {
12
    std::string key(name);
98✔
13
    const char* value = std::getenv(key.c_str());
98!
14
    if (value == nullptr || value[0] == '\0') {
98!
15
        return std::nullopt;
98✔
16
    }
17
    return std::string_view(value);
×
18
}
98✔
19

20
template <>
21
std::optional<int> Env::get<int>(std::string_view name) {
98✔
22
    auto value = get<std::string_view>(name);
98✔
23
    if (!value.has_value()) {
98!
24
        return std::nullopt;
98✔
25
    }
26

27
    int parsed = 0;
×
28
    auto* begin = value->data();
×
29
    auto* end = begin + value->size();
×
30
    auto [ptr, ec] = std::from_chars(begin, end, parsed);
×
31
    if (ec != std::errc{} || ptr != end) {
×
32
        return std::nullopt;
×
33
    }
34
    return parsed;
×
35
}
98✔
36

37
int Env::rocksdb_max_open_files() {
5,929✔
38
    static const int cached_value = [] {
6,027!
39
        constexpr int default_max_open_files = 32;
98✔
40
        constexpr std::string_view env_name =
98✔
41
            "DFTRACER_UTILS_ROCKSDB_MAX_OPEN_FILES";
42

43
        auto configured = get<int>(env_name);
98✔
44
        if (!configured.has_value()) {
98!
45
            return default_max_open_files;
98✔
46
        }
47

48
        if (*configured == -1 || *configured > 0) {
×
49
            return *configured;
×
50
        }
51
        return default_max_open_files;
×
52
    }();
98✔
53

54
    return cached_value;
5,929✔
55
}
×
56

57
}  // namespace dftracer::utils
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