Skip to content

Commit

Permalink
add dictionary size to status table
Browse files Browse the repository at this point in the history
  • Loading branch information
tony2001 committed Nov 20, 2015
1 parent 06f730d commit e0e556b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion default_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -521,5 +521,6 @@ CREATE TABLE `status` (
`lost_tmp_records` int(11) NOT NULL,
`invalid_packets` int(11) NOT NULL,
`invalid_request_data` int(11) NOT NULL,
`build_string` varchar(256) DEFAULT NULL
`build_string` varchar(256) DEFAULT NULL,
`dictionary_size` int(11) NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='status';
6 changes: 6 additions & 0 deletions src/ha_pinba.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5671,6 +5671,12 @@ inline int ha_pinba::status_fetch_row(unsigned char *buf) /* {{{ */
(*field)->store((const char *)PINBA_ENGINE_PINBA_BUILD_STRING, strlen((char *)PINBA_ENGINE_PINBA_BUILD_STRING), &my_charset_bin);
#endif
break;
case 6: /* dictionary size */
(*field)->set_notnull();
pthread_rwlock_rdlock(&D->words_lock);
(*field)->store((long)pinba_map_count(D->dictionary));
pthread_rwlock_unlock(&D->words_lock);
break;
}
}
}
Expand Down

0 comments on commit e0e556b

Please sign in to comment.