MCPcopy Create free account
hub / github.com/ceph/ceph / json

Method json

src/tools/cephfs/EventOutput.cc:65–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65int EventOutput::json() const
66{
67 JSONFormatter jf(true);
68 std::ofstream out_file(path.c_str(), std::ofstream::out);
69 jf.open_array_section("journal");
70 {
71 for (JournalScanner::EventMap::const_iterator i = scan.events.begin(); i != scan.events.end(); ++i) {
72 if (auto& le = i->second.log_event; le) {
73 jf.open_object_section("log_event");
74 le->dump(&jf);
75 jf.close_section(); // log_event
76 } else if (auto& pi = i->second.pi; pi) {
77 jf.open_object_section("purge_action");
78 pi->dump(&jf);
79 jf.close_section();
80 }
81 }
82 }
83 jf.close_section(); // journal
84 jf.flush(out_file);
85 out_file.close();
86
87 if (out_file.fail()) {
88 return -EIO;
89 } else {
90 std::cerr << "Wrote output to JSON file '" << path << "'" << std::endl;
91 return 0;
92 }
93}
94
95void EventOutput::list() const
96{

Calls 10

c_strMethod · 0.45
open_array_sectionMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
open_object_sectionMethod · 0.45
dumpMethod · 0.45
close_sectionMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45
failMethod · 0.45

Tested by 11

test_list_containersFunction · 0.36
test_expired_tokenFunction · 0.36
_get_urlMethod · 0.36
_put_flagsMethod · 0.36
_fetch_pr_pagesMethod · 0.36
_fetch_check_runsMethod · 0.36
_fetch_statusesMethod · 0.36