MCPcopy Create free account
hub / github.com/apache/trafficserver / TxnBoxInit

Function TxnBoxInit

plugins/experimental/txn_box/plugin/src/txn_box.cc:174–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174Errata
175TxnBoxInit()
176{
177 TSPluginRegistrationInfo info{Config::PLUGIN_TAG.data(), "Verizon Media", "solidwallofcode@verizonmedia.com"};
178
179 Plugin_Config = std::make_shared<Config>();
180 auto t0 = std::chrono::system_clock::now();
181 auto errata = Plugin_Config->load_cli_args(Plugin_Config, G._args, 1);
182 if (!errata.is_ok()) {
183 return errata;
184 }
185 auto delta = std::chrono::system_clock::now() - t0;
186 std::string text;
187 TS_DBG("%s", swoc::bwprint(text, "{} files loaded in {} ms.", Plugin_Config->file_count(),
188 std::chrono::duration_cast<std::chrono::milliseconds>(delta).count())
189 .c_str());
190
191 if (TSPluginRegister(&info) == TS_SUCCESS) {
192 TSCont cont{TSContCreate(CB_Txn_Start, nullptr)};
193 TSHttpHookAdd(TS_HTTP_TXN_START_HOOK, cont);
194 G.reserve_txn_arg();
195 } else {
196 errata.note(R"({}: plugin registration failed.)", Config::PLUGIN_TAG);
197 return errata;
198 }
199 return {};
200}
201
202void
203TSPluginInit(int argc, char const *argv[])

Callers 1

TSPluginInitFunction · 0.85

Calls 12

TSPluginRegisterFunction · 0.85
TSContCreateFunction · 0.85
TSHttpHookAddFunction · 0.85
load_cli_argsMethod · 0.80
file_countMethod · 0.80
reserve_txn_argMethod · 0.80
nowFunction · 0.50
dataMethod · 0.45
is_okMethod · 0.45
c_strMethod · 0.45
countMethod · 0.45
noteMethod · 0.45

Tested by

no test coverage detected