| 84 | } |
| 85 | |
| 86 | void |
| 87 | TSPluginInit(int /* argc ATS_UNUSED */, const char ** /* argv ATS_UNUSED */) |
| 88 | { |
| 89 | TSCont contp; |
| 90 | TSPluginRegistrationInfo info; |
| 91 | |
| 92 | info.plugin_name = PLUGIN_NAME; |
| 93 | info.vendor_name = "Apache Software Foundation"; |
| 94 | info.support_email = "dev@trafficserver.apache.org"; |
| 95 | |
| 96 | if (TSPluginRegister(&info) != TS_SUCCESS) { |
| 97 | TSError("[%s] Plugin registration failed.\n", PLUGIN_NAME); |
| 98 | |
| 99 | goto error; |
| 100 | } |
| 101 | |
| 102 | transaction_count_stat = TSStatCreate("transaction.count", TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 103 | session_count_stat = TSStatCreate("session.count", TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 104 | |
| 105 | contp = TSContCreate(ssn_handler, nullptr); |
| 106 | TSHttpHookAdd(TS_HTTP_SSN_START_HOOK, contp); |
| 107 | |
| 108 | error: |
| 109 | TSError("[%s] Plugin not initialized", PLUGIN_NAME); |
| 110 | } |
nothing calls this directly
no test coverage detected