@@ -196,15 +196,15 @@ void NetworkStatusNotifier::ReportConnectionStats() {
196
196
}
197
197
198
198
bool NetworkStatusNotifier::UpdateAllConnsAndEndpoints () {
199
- if (turn_off_scraping_ ) {
199
+ if (config_. TurnOffScrape () ) {
200
200
return true ;
201
201
}
202
202
203
203
int64_t ts = NowMicros ();
204
204
std::vector<Connection> all_conns;
205
205
std::vector<ContainerEndpoint> all_listen_endpoints;
206
206
WITH_TIMER (CollectorStats::net_scrape_read) {
207
- bool success = conn_scraper_->Scrape (&all_conns, scrape_listen_endpoints_ ? &all_listen_endpoints : nullptr );
207
+ bool success = conn_scraper_->Scrape (&all_conns, config_. ScrapeListenEndpoints () ? &all_listen_endpoints : nullptr );
208
208
if (!success) {
209
209
CLOG (ERROR) << " Failed to scrape connections and no pending connections to send" ;
210
210
return false ;
@@ -227,7 +227,7 @@ void NetworkStatusNotifier::RunSingle(IDuplexClientWriter<sensor::NetworkConnect
227
227
228
228
while (writer->Sleep (next_scrape)) {
229
229
CLOG (DEBUG) << " Starting network status notification" ;
230
- next_scrape = std::chrono::system_clock::now () + std::chrono::seconds (scrape_interval_ );
230
+ next_scrape = std::chrono::system_clock::now () + std::chrono::seconds (config_. ScrapeInterval () );
231
231
232
232
if (!UpdateAllConnsAndEndpoints ()) {
233
233
CLOG (DEBUG) << " No connection or endpoint to report" ;
@@ -244,8 +244,8 @@ void NetworkStatusNotifier::RunSingle(IDuplexClientWriter<sensor::NetworkConnect
244
244
conn_tracker_->EnableExternalIPs (config_.EnableExternalIPs ());
245
245
246
246
new_conn_state = conn_tracker_->FetchConnState (true , true );
247
- if (enable_afterglow_ ) {
248
- ConnectionTracker::ComputeDeltaAfterglow (new_conn_state, old_conn_state, delta_conn, time_micros, time_at_last_scrape, afterglow_period_micros_ );
247
+ if (config_. EnableAfterglow () ) {
248
+ ConnectionTracker::ComputeDeltaAfterglow (new_conn_state, old_conn_state, delta_conn, time_micros, time_at_last_scrape, config_. AfterglowPeriod () );
249
249
} else {
250
250
ConnectionTracker::ComputeDelta (new_conn_state, &old_conn_state);
251
251
}
@@ -255,9 +255,9 @@ void NetworkStatusNotifier::RunSingle(IDuplexClientWriter<sensor::NetworkConnect
255
255
}
256
256
257
257
WITH_TIMER (CollectorStats::net_create_message) {
258
- if (enable_afterglow_ ) {
258
+ if (config_. EnableAfterglow () ) {
259
259
msg = CreateInfoMessage (delta_conn, old_cep_state);
260
- ConnectionTracker::UpdateOldState (&old_conn_state, new_conn_state, time_micros, afterglow_period_micros_ );
260
+ ConnectionTracker::UpdateOldState (&old_conn_state, new_conn_state, time_micros, config_. AfterglowPeriod () );
261
261
} else {
262
262
msg = CreateInfoMessage (old_conn_state, old_cep_state);
263
263
old_conn_state = std::move (new_conn_state);
0 commit comments