SELECT JSON_EXTRACT(mysql_info, '$.options.use_ssl') use_ssl , COUNT(*) FROM stats_mysql_free_connections GROUP BY JSON_EXTRACT(mysql_info, '$.options.use_ssl');
For frontend connections you need to enable extended_info , and then query stats_mysql_processlist :
SET mysql-show_processlist_extended=1;
LOAD MYSQL VARIABLES TO RUNTIME;
SELECT JSON_EXTRACT(extended_info, '$.client.encrypted') use_ssl , COUNT(*) FROM stats_mysql_processlist GROUP BY JSON_EXTRACT(extended_info, '$.client.encrypted');
For backend connections in use the query is a bit more complicated because backend information is stored in an JSON array for each client connection.
This is the query:
SELECT
JSON_EXTRACT(backends.value,'$.conn.mysql.options.use_ssl') use_ssl ,
COUNT(*)
FROM stats_mysql_processlist
JOIN JSON_EACH(JSON_EXTRACT(stats_mysql_processlist.extended_info, '$.backends')) backends
GROUP BY JSON_EXTRACT(backends.value,'$.conn.mysql.options.use_ssl');
Thanks,
René
--
You received this message because you are subscribed to the Google Groups "proxysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/proxysql/1268b793-220c-483c-9562-5b7036b0cdccn%40googlegroups.com.