• 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

40.38
/src/dftracer/utils/utilities/reader/internal/reader_factory.cpp
1
#include <dftracer/utils/core/common/format_detector.h>
2
#include <dftracer/utils/core/common/logging.h>
3
#include <dftracer/utils/utilities/indexer/internal/gzip/gzip_indexer.h>
4
#include <dftracer/utils/utilities/indexer/internal/tar/tar_indexer.h>
5
#include <dftracer/utils/utilities/reader/error.h>
6
#include <dftracer/utils/utilities/reader/internal/gzip_reader.h>
7
#include <dftracer/utils/utilities/reader/internal/reader_factory.h>
8
#include <dftracer/utils/utilities/reader/internal/tar_reader.h>
9

10
#include <stdexcept>
11

12
namespace dftracer::utils::utilities::reader::internal {
13

14
std::shared_ptr<Reader> ReaderFactory::create(const std::string &archive_path,
479✔
15
                                              const std::string &index_path,
16
                                              std::size_t index_ckpt_size) {
17
    ArchiveFormat format = FormatDetector::detect(archive_path);
479✔
18

19
    DFTRACER_UTILS_LOG_DEBUG(
479!
20
        "ReaderFactory::create_reader - detected format: %d for file: %s",
21
        static_cast<int>(format), archive_path.c_str());
22

23
    switch (format) {
479!
24
        case ArchiveFormat::GZIP:
25
            return std::make_shared<GzipReader>(archive_path, index_path,
478✔
26
                                                index_ckpt_size);
27

28
        case ArchiveFormat::TAR_GZ:
29
            return std::make_shared<TarReader>(archive_path, index_path,
1✔
30
                                               index_ckpt_size);
31

32
        default:
NEW
33
            throw ReaderError(
×
34
                ReaderError::INVALID_ARGUMENT,
NEW
35
                "Unsupported archive format for file: " + archive_path);
×
36
    }
37
}
479✔
38

39
std::shared_ptr<Reader> ReaderFactory::create(
139✔
40
    std::shared_ptr<dftracer::utils::utilities::indexer::internal::Indexer>
41
        indexer) {
42
    if (!indexer) {
139!
NEW
43
        throw ReaderError(ReaderError::INVALID_ARGUMENT,
×
NEW
44
                          "Indexer cannot be null");
×
45
    }
46

47
    if (indexer->get_format_type() == ArchiveFormat::TAR_GZ) {
139✔
48
        return std::make_shared<TarReader>(
11!
49
            std::static_pointer_cast<
11✔
50
                dftracer::utils::utilities::indexer::internal::tar::TarIndexer>(
51
                indexer));
52
    }
53

54
    return std::make_shared<GzipReader>(indexer);
128✔
55
}
139✔
56

57
bool ReaderFactory::is_format_supported(ArchiveFormat format) {
×
58
    switch (format) {
×
59
        case ArchiveFormat::GZIP:
60
        case ArchiveFormat::TAR_GZ:
61
            return true;
×
62
        default:
63
            return false;
×
64
    }
UNCOV
65
}
×
66
}  // namespace dftracer::utils::utilities::reader::internal
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