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

llnl / dftracer-utils / 28496595030

01 Jul 2026 05:50AM UTC coverage: 50.727% (-1.6%) from 52.278%
28496595030

Pull #83

github

web-flow
Merge 8f1ff4df5 into 2efed6649
Pull Request #83: refactor and improve code QoL

31872 of 80367 branches covered (39.66%)

Branch coverage included in aggregate %.

770 of 1591 new or added lines in 85 files covered. (48.4%)

5070 existing lines in 182 files now uncovered.

32742 of 47009 relevant lines covered (69.65%)

9887.52 hits per line

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

48.33
/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>(
778✔
11
    std::string_view name) {
12
    std::string key(name);
778✔
13
    const char* value = std::getenv(key.c_str());
778!
14
    if (value == nullptr || value[0] == '\0') {
778!
15
        return std::nullopt;
778✔
16
    }
17
    return std::string_view(value);
×
18
}
778✔
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() {
6,009✔
38
    static const int cached_value = [] {
6,107!
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;
6,009✔
UNCOV
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