| 12 | constexpr char module_type[] = "http"; |
| 13 | |
| 14 | void SetHttpConfig(const FunctionCallbackInfo<Value>& info) { |
| 15 | EnvironmentData* env_data = EnvironmentData::GetCurrent(info); |
| 16 | if (!env_data) { |
| 17 | return; |
| 18 | } |
| 19 | HttpStatistics* http_statistics = env_data->http_statistics(); |
| 20 | |
| 21 | v8::Isolate* isolate = info.GetIsolate(); |
| 22 | HandleScope scope(isolate); |
| 23 | |
| 24 | if (!info[0]->IsObject()) { |
| 25 | Nan::ThrowTypeError("Argument should be an object"); |
| 26 | return; |
| 27 | } |
| 28 | |
| 29 | v8::Local<v8::Object> config = Nan::To<v8::Object>(info[0]).ToLocalChecked(); |
| 30 | |
| 31 | // init |
| 32 | http_statistics->config.Reset(config); |
| 33 | http_statistics->config_initialized = true; |
| 34 | } |
| 35 | |
| 36 | void AddLiveRequest(const FunctionCallbackInfo<Value>& info) { |
| 37 | EnvironmentData* env_data = EnvironmentData::GetCurrent(info); |
nothing calls this directly
no test coverage detected