Browse code

Instead of showing all threads show multiscan threads, it is less confusing.

git-svn: trunk@4418

Török Edvin authored on 2008/11/17 01:46:20
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Sun Nov 16 17:44:39 EET 2008 (edwin)
2
+------------------------------------
3
+ * contrib/clamdtop/clamdtop.c: Instead of showing all threads show
4
+ multiscan threads, it is less confusing.
5
+
1 6
 Sun Nov 16 17:35:23 EET 2008 (edwin)
2 7
 ------------------------------------
3 8
  * contrib/clamdtop/Makefile, contrib/clamdtop/clamdtop.c: fix queue
... ...
@@ -823,7 +823,7 @@ static int output_stats(struct stats *stats, unsigned idx)
823 823
 		print_colored(win, buf);
824 824
 		show_bar(win, i++, stats->prim_live, stats->prim_idle, stats->prim_max, 0);
825 825
 
826
-		mvwprintw(win, i++, 0, "All     threads: ");
826
+		mvwprintw(win, i++, 0, "Multiscan pool : ");
827 827
 		snprintf(buf, sizeof(buf), "live %3u idle %3u max %3u", stats->live, stats->idle, stats->max);
828 828
 		print_colored(win, buf);
829 829
 		show_bar(win, i++, stats->live, stats->idle, stats->max, 0);
... ...
@@ -980,10 +980,11 @@ static void parse_stats(conn_t *conn, struct stats *stats, unsigned idx)
980 980
 				stats->prim_idle = idle;
981 981
 				assert(!stats->prim_max && "There can be only one primary pool!");
982 982
 				stats->prim_max = max;
983
+			} else {
984
+				stats->live += live;
985
+				stats->idle += idle;
986
+				stats->max += max;
983 987
 			}
984
-			stats->live += live;
985
-			stats->idle += idle;
986
-			stats->max += max;
987 988
 		} else if (!strcmp("Queue",buf)) {
988 989
 			unsigned len;
989 990
 			if(sscanf(val, "%u", &len) != 1)
... ...
@@ -1101,7 +1102,7 @@ static int show_help(void)
1101 1101
 	explain("DBVER", "Database version");
1102 1102
 	explain("DBTIME", "Database publish time");
1103 1103
 	explain("Primary threads", "Threadpool used to receive commands");
1104
-	explain("All threads","All threadpools, including multiscan");
1104
+	explain("Multiscan pool","Threadpool used for multiscan");
1105 1105
 	explain("live","Executing commands, or scanning");
1106 1106
 	explain("idle","Waiting for commands, will exit after idle_timeout");
1107 1107
 	explain("max", "Maximum number of threads configured for this pool");