@@ -289,106 +289,6 @@ static ENGINE_ERROR_CODE server_stats(ADD_STAT add_stat_callback,
289289 return ENGINE_SUCCESS;
290290}
291291
292- static void process_stat_settings (ADD_STAT add_stat_callback, Cookie& cookie) {
293- if (add_stat_callback == nullptr ) {
294- throw std::invalid_argument (" process_stat_settings: "
295- " add_stat_callback must be non-NULL" );
296- }
297- add_stat (cookie, add_stat_callback, " maxconns" , settings.getMaxconns ());
298-
299- try {
300- for (auto & ifce : stats.listening_ports ) {
301- char interface[1024 ];
302- int offset;
303- if (ifce.host .empty ()) {
304- offset = checked_snprintf (interface, sizeof (interface),
305- " interface-*:%u" ,
306- ifce.port );
307- } else {
308- offset = checked_snprintf (interface, sizeof (interface),
309- " interface-%s:%u" ,
310- ifce.host .c_str (),
311- ifce.port );
312- }
313-
314- checked_snprintf (interface + offset, sizeof (interface) - offset,
315- " -maxconn" );
316- add_stat (cookie, add_stat_callback, interface, ifce.maxconns );
317- checked_snprintf (interface + offset, sizeof (interface) - offset,
318- " -ipv4" );
319- add_stat (cookie, add_stat_callback, interface, ifce.ipv4 );
320- checked_snprintf (interface + offset, sizeof (interface) - offset,
321- " -ipv6" );
322- add_stat (cookie, add_stat_callback, interface, ifce.ipv6 );
323-
324- checked_snprintf (interface + offset, sizeof (interface) - offset,
325- " -tcp_nodelay" );
326- add_stat (cookie, add_stat_callback, interface, ifce.tcp_nodelay );
327-
328- auto ssl = ifce.getSslSettings ();
329- if (ssl) {
330- checked_snprintf (interface + offset, sizeof (interface) - offset,
331- " -ssl-pkey" );
332- add_stat (cookie, add_stat_callback, interface, ssl->key );
333- checked_snprintf (interface + offset, sizeof (interface) - offset,
334- " -ssl-cert" );
335- add_stat (cookie, add_stat_callback, interface, ssl->cert );
336- } else {
337- checked_snprintf (interface + offset, sizeof (interface) - offset,
338- " -ssl" );
339- add_stat (cookie, add_stat_callback, interface, " false" );
340- }
341- }
342- } catch (const std::exception& error) {
343- LOG_WARNING (" process_stats_settings: Error building stats: {}" ,
344- error.what ());
345- }
346-
347- add_stat (cookie, add_stat_callback, " verbosity" , settings.getVerbose ());
348- add_stat (cookie, add_stat_callback, " num_threads" , settings.getNumWorkerThreads ());
349- add_stat (cookie, add_stat_callback, " reqs_per_event_high_priority" ,
350- settings.getRequestsPerEventNotification (EventPriority::High));
351- add_stat (cookie, add_stat_callback, " reqs_per_event_med_priority" ,
352- settings.getRequestsPerEventNotification (EventPriority::Medium));
353- add_stat (cookie, add_stat_callback, " reqs_per_event_low_priority" ,
354- settings.getRequestsPerEventNotification (EventPriority::Low));
355- add_stat (cookie, add_stat_callback, " reqs_per_event_def_priority" ,
356- settings.getRequestsPerEventNotification (EventPriority::Default));
357- add_stat (cookie, add_stat_callback, " auth_enabled_sasl" , " yes" );
358- add_stat (cookie, add_stat_callback, " auth_sasl_engine" , " cbsasl" );
359-
360- add_stat (cookie, add_stat_callback, " audit" ,
361- settings.getAuditFile ().c_str ());
362-
363- add_stat (cookie, add_stat_callback, " connection_idle_time" ,
364- std::to_string (settings.getConnectionIdleTime ()).c_str ());
365- add_stat (cookie,
366- add_stat_callback,
367- " datatype_json" ,
368- settings.isDatatypeJsonEnabled () ? " true" : " false" );
369- add_stat (cookie,
370- add_stat_callback,
371- " datatype_snappy" ,
372- settings.isDatatypeSnappyEnabled () ? " true" : " false" );
373- add_stat (cookie, add_stat_callback, " dedupe_nmvb_maps" ,
374- settings.isDedupeNmvbMaps () ? " true" : " false" );
375- add_stat (cookie, add_stat_callback, " max_packet_size" ,
376- std::to_string (settings.getMaxPacketSize ()).c_str ());
377- add_stat (cookie, add_stat_callback, " xattr_enabled" ,
378- settings.isXattrEnabled ());
379- add_stat (cookie, add_stat_callback, " privilege_debug" ,
380- settings.isPrivilegeDebug ());
381-
382- add_stat (cookie,
383- add_stat_callback,
384- " collections_enabled" ,
385- settings.isCollectionsEnabled ());
386- add_stat (cookie,
387- add_stat_callback,
388- " external_auth_service" ,
389- settings.isExternalAuthServiceEnabled ());
390- }
391-
392292static void append_bin_stats (const char * key,
393293 const uint16_t klen,
394294 const char * val,
@@ -529,23 +429,6 @@ static ENGINE_ERROR_CODE stat_sched_executor(const std::string& arg,
529429 }
530430}
531431
532- /* *
533- * Handler for the <code>stats settings</code> used to get the current
534- * settings.
535- *
536- * @param arg - should be empty
537- * @param cookie the command context
538- */
539- static ENGINE_ERROR_CODE stat_settings_executor (const std::string& arg,
540- Cookie& cookie) {
541- if (arg.empty ()) {
542- process_stat_settings (&append_stats, cookie);
543- return ENGINE_SUCCESS;
544- } else {
545- return ENGINE_EINVAL;
546- }
547- }
548-
549432/* *
550433 * Handler for the <code>stats audit</code> used to get statistics from
551434 * the audit subsystem.
@@ -849,7 +732,6 @@ static std::unordered_map<std::string, struct command_stat_handler>
849732 {" " , {false , stat_all_stats}},
850733 {" reset" , {true , stat_reset_executor}},
851734 {" worker_thread_info" , {false , stat_sched_executor}},
852- {" settings" , {false , stat_settings_executor}},
853735 {" audit" , {true , stat_audit_executor}},
854736 {" bucket_details" , {true , stat_bucket_details_executor}},
855737 {" aggregate" , {false , stat_aggregate_executor}},
0 commit comments