• 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

18.02
/src/dftracer/utils/utilities/common/json/json_value.cpp
1
#include <dftracer/utils/core/coro/task.h>
2
#include <dftracer/utils/utilities/common/json/json_value.h>
3
#include <dftracer/utils/utilities/fileio/file_reader_utility.h>
4

5
#include <cstring>
6

7
namespace dftracer::utils::utilities::common::json {
8

9
JsonValue JsonValue::at(const char* path) const {
5,377✔
10
    if (!valid_ || !path) return JsonValue();
5,377!
11

12
    JsonValue current = *this;
5,377✔
13
    const char* start = path;
5,377✔
14

15
    while (*start) {
10,751✔
16
        const char* end = start;
5,386✔
17
        while (*end && *end != '.') end++;
20,951✔
18

19
        size_t key_len = end - start;
5,386✔
20
        if (key_len == 0) {
5,386!
21
            start = (*end == '.') ? end + 1 : end;
×
22
            continue;
×
23
        }
24

25
        std::string_view key_sv(start, key_len);
5,386✔
26
        current = current[key_sv];
5,386✔
27

28
        if (!current.exists()) {
5,386✔
29
            return JsonValue();
12✔
30
        }
31

32
        start = (*end == '.') ? end + 1 : end;
5,374✔
33
    }
34

35
    return current;
5,365✔
36
}
5,377✔
37

38
JsonValue JsonValue::at(const std::string& path) const {
5,377✔
39
    return at(path.c_str());
5,377✔
40
}
41

42
JsonValue JsonValue::at(std::string_view path) const {
×
43
    std::string path_str(path);
×
44
    return at(path_str.c_str());
×
45
}
×
46

47
coro::CoroTask<StringJsonParserInput> StringJsonParserInput::from_file_async(
×
UNCOV
48
    const std::string& file_path) {
×
UNCOV
49
    StringJsonParserInput input;
×
UNCOV
50
    utilities::fileio::FileReaderUtility file_reader;
×
UNCOV
51
    utilities::filesystem::FileEntry file_entry{file_path};
×
UNCOV
52
    input.content = co_await file_reader.process(file_entry);
×
UNCOV
53
    co_return input;
×
54
}
×
55

56
StringJsonParserInput StringJsonParserInput::from_file(
×
57
    const std::string& file_path) {
58
    return from_file_async(file_path).get();
×
UNCOV
59
}
×
60

61
StringJsonParserInput StringJsonParserInput::from_string(
×
62
    const std::string& json_str) {
63
    StringJsonParserInput input;
×
64
    input.content.content = json_str;
×
65
    return input;
×
66
}
×
67

68
coro::CoroTask<JsonParserOutput> StringJsonParserUtility::process(
×
UNCOV
69
    const StringJsonParserInput& input) {
×
UNCOV
70
    content_ = input.content;
×
71

UNCOV
72
    auto result =
×
UNCOV
73
        parser_.parse(content_.content.data(), content_.content.size());
×
UNCOV
74
    if (result.error()) {
×
UNCOV
75
        co_return JsonValue();
×
76
    }
UNCOV
77
    co_return JsonValue(result.value_unsafe());
×
78
}
×
79

80
void StringJsonParserUtility::reset() { content_ = utilities::text::Text{}; }
×
81

82
}  // namespace dftracer::utils::utilities::common::json
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