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

llnl / dftracer-utils / 30067416336

24 Jul 2026 04:40AM UTC coverage: 50.693% (-2.0%) from 52.66%
30067416336

Pull #99

github

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

18063 of 48203 branches covered (37.47%)

Branch coverage included in aggregate %.

1514 of 2204 new or added lines in 58 files covered. (68.69%)

741 existing lines in 114 files now uncovered.

23715 of 34210 relevant lines covered (69.32%)

39842.55 hits per line

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

48.98
/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,
500✔
15
                                              const std::string &index_path,
16
                                              std::size_t index_ckpt_size) {
17
    ArchiveFormat format = FormatDetector::detect(archive_path);
500✔
18

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

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

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

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

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

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

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

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