@@ -515,12 +515,8 @@ impl ClickHouse {
515515 (SELECT sum(total_bytes) FROM {async_inserts} {host_filter_where}) AS memory_async_inserts_,
516516 {memory_index_granularity_trait},
517517 (SELECT count() FROM {one} {host_filter_where}) AS servers_,
518- (SELECT count() FROM {processes} {host_filter_where}) AS queries_,
519- (SELECT count() FROM {merges} {host_filter_where}) AS merges_,
520- (SELECT count() FROM {mutations} WHERE NOT is_done {host_filter_and}) AS mutations_,
521518 (SELECT count() FROM {replication_queue} {host_filter_where}) AS replication_queue_,
522- (SELECT sum(num_tries) FROM {replication_queue} {host_filter_where}) AS replication_queue_tries_,
523- (SELECT count() FROM {fetches} {host_filter_where}) AS fetches_
519+ (SELECT sum(num_tries) FROM {replication_queue} {host_filter_where}) AS replication_queue_tries_
524520 SELECT
525521 assumeNotNull(memory_tracked_) AS memory_tracked,
526522 assumeNotNull(memory_merges_mutations_) AS memory_merges_mutations,
@@ -531,12 +527,8 @@ impl ClickHouse {
531527 assumeNotNull(memory_dictionaries_) AS memory_dictionaries,
532528 assumeNotNull(memory_async_inserts_) AS memory_async_inserts,
533529 assumeNotNull(servers_) AS servers,
534- assumeNotNull(queries_) AS queries,
535- assumeNotNull(merges_) AS merges,
536- assumeNotNull(mutations_) AS mutations,
537530 assumeNotNull(replication_queue_) AS replication_queue,
538531 assumeNotNull(replication_queue_tries_) AS replication_queue_tries,
539- assumeNotNull(fetches_) AS fetches,
540532
541533 max2(assumeNotNull(memory_index_granularity_), asynchronous_metrics.memory_index_granularity)::UInt64 AS memory_index_granularity,
542534
@@ -610,6 +602,11 @@ impl ClickHouse {
610602 ) as events,
611603 (
612604 SELECT
605+ sumIf(CAST(value AS UInt64), metric == 'Query') AS queries,
606+ sumIf(CAST(value AS UInt64), metric == 'Merge') AS merges,
607+ sumIf(CAST(value AS UInt64), metric == 'PartMutation') AS mutations,
608+ sumIf(CAST(value AS UInt64), metric == 'ReplicatedFetch') AS fetches,
609+
613610 sumIf(CAST(value AS UInt64), metric == 'StorageBufferBytes') AS storage_buffer_bytes,
614611 sumIf(CAST(value AS UInt64), metric == 'DistributedFilesToInsert') AS storage_distributed_insert_files,
615612
@@ -655,9 +652,7 @@ impl ClickHouse {
655652 processes=self . get_table_name_no_history( "system" , "processes" ) ,
656653 merges=self . get_table_name_no_history( "system" , "merges" ) ,
657654 async_inserts=self . get_table_name_no_history( "system" , "asynchronous_inserts" ) ,
658- mutations=self . get_table_name_no_history( "system" , "mutations" ) ,
659655 replication_queue=self . get_table_name_no_history( "system" , "replication_queue" ) ,
660- fetches=self . get_table_name_no_history( "system" , "replicated_fetches" ) ,
661656 dictionaries=self . get_table_name_no_history( "system" , "dictionaries" ) ,
662657 asynchronous_metrics=self . get_table_name_no_history( "system" , "asynchronous_metrics" ) ,
663658 one=self . get_table_name_no_history( "system" , "one" ) ,
@@ -682,12 +677,12 @@ impl ClickHouse {
682677 } ;
683678
684679 return Ok ( ClickHouseServerSummary {
685- queries : get ( "queries" ) ,
686- merges : get ( "merges" ) ,
687- mutations : get ( "mutations" ) ,
680+ queries : get ( "metrics. queries" ) ,
681+ merges : get ( "metrics. merges" ) ,
682+ mutations : get ( "metrics. mutations" ) ,
688683 replication_queue : get ( "replication_queue" ) ,
689684 replication_queue_tries : get ( "replication_queue_tries" ) ,
690- fetches : get ( "fetches" ) ,
685+ fetches : get ( "metrics. fetches" ) ,
691686 servers : get ( "servers" ) ,
692687
693688 uptime : ClickHouseServerUptime {
0 commit comments