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

llnl / dftracer-utils / 29787659139

20 Jul 2026 11:34PM UTC coverage: 51.578% (-1.1%) from 52.66%
29787659139

Pull #99

github

web-flow
Merge ee805adeb into 06bc84ec9
Pull Request #99: Support CM time_metric (NS/MS/SEC/US) across reader and viz

34832 of 86278 branches covered (40.37%)

Branch coverage included in aggregate %.

1034 of 1319 new or added lines in 30 files covered. (78.39%)

5193 existing lines in 197 files now uncovered.

35349 of 49791 relevant lines covered (70.99%)

9765.54 hits per line

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

55.0
/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>(
1,869✔
11
    std::string_view name) {
12
    std::string key(name);
1,869✔
13
    const char* value = std::getenv(key.c_str());
1,869!
14
    if (value == nullptr || value[0] == '\0') {
1,869!
15
        return std::nullopt;
1,868✔
16
    }
17
    return std::string_view(value);
1!
18
}
1,869✔
19

20
template <>
21
std::optional<int> Env::get<int>(std::string_view name) {
109✔
22
    auto value = get<std::string_view>(name);
109✔
23
    if (!value.has_value()) {
109!
24
        return std::nullopt;
109✔
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
}
109✔
36

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

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

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

54
    return cached_value;
6,517✔
UNCOV
55
}
×
56

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

© 2026 Coveralls, Inc