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

llnl / dftracer-utils / 28521653886

01 Jul 2026 01:36PM UTC coverage: 50.92% (-1.4%) from 52.278%
28521653886

Pull #83

github

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

31893 of 80049 branches covered (39.84%)

Branch coverage included in aggregate %.

789 of 1613 new or added lines in 87 files covered. (48.92%)

5007 existing lines in 181 files now uncovered.

32812 of 47024 relevant lines covered (69.78%)

9905.42 hits per line

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

40.96
/src/dftracer/utils/utilities/common/json/parser.cpp
1
#include <dftracer/utils/utilities/common/json/parser.h>
2

3
namespace dftracer::utils::utilities::common::json {
4

5
JsonParser::JsonParser(std::size_t capacity) : parser_(capacity) {}
516✔
6

7
bool JsonParser::parse(std::string_view json_line) {
5,776✔
8
    padded_json_ = simdjson::padded_string(json_line);
5,776✔
9
    auto result = parser_.iterate(padded_json_);
5,776✔
10
    if (result.error()) {
5,776!
11
        valid_ = false;
×
12
        return false;
×
13
    }
14
    doc_ = std::move(result.value());
5,776✔
15
    active_ = simdjson::ondemand::document_reference(doc_);
5,776✔
16
    valid_ = true;
5,776✔
17
    return true;
5,776✔
18
}
5,776✔
19

20
bool JsonParser::parse_padded(simdjson::padded_string_view json) {
×
21
    auto result = parser_.iterate(json);
×
22
    if (result.error()) {
×
23
        valid_ = false;
×
24
        return false;
×
25
    }
26
    doc_ = std::move(result.value());
×
27
    active_ = simdjson::ondemand::document_reference(doc_);
×
28
    valid_ = true;
×
29
    return true;
×
UNCOV
30
}
×
31

32
void JsonParser::rewind() {
910✔
33
    if (valid_) {
910!
34
        active_.rewind();
910✔
35
    }
910✔
36
}
910✔
37

38
std::optional<std::int64_t> JsonParser::get_int64(std::string_view key) {
×
39
    if (!valid_) return std::nullopt;
×
40
    auto result = active_[key].get_int64();
×
41
    if (result.error()) return std::nullopt;
×
42
    return result.value();
×
UNCOV
43
}
×
44

45
std::optional<std::uint64_t> JsonParser::get_uint64(std::string_view key) {
424✔
46
    if (!valid_) return std::nullopt;
424!
47
    auto result = active_[key].get_uint64();
424✔
48
    if (result.error()) return std::nullopt;
424!
49
    return result.value();
424✔
50
}
424✔
51

52
std::optional<double> JsonParser::get_double(std::string_view key) {
×
53
    if (!valid_) return std::nullopt;
×
54
    auto result = active_[key].get_double();
×
55
    if (result.error()) return std::nullopt;
×
56
    return result.value();
×
UNCOV
57
}
×
58

59
std::optional<bool> JsonParser::get_bool(std::string_view key) {
×
60
    if (!valid_) return std::nullopt;
×
61
    auto result = active_[key].get_bool();
×
62
    if (result.error()) return std::nullopt;
×
63
    return result.value();
×
UNCOV
64
}
×
65

66
std::optional<std::string_view> JsonParser::get_string(std::string_view key) {
922✔
67
    if (!valid_) return std::nullopt;
922!
68
    auto result = active_[key].get_string();
922✔
69
    if (result.error()) return std::nullopt;
922✔
70
    return result.value();
920✔
71
}
922✔
72

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